Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(instrumenter): don't place mutants inside delete expressions #4742

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

nicojs
Copy link
Member

@nicojs nicojs commented Feb 20, 2024

Don't place mutants inside a delete expression.

Before:

delete stryMutAct_9fa48(\\"11\\") ? myVariable[indexer] : (stryCov_9fa48(\\"11\\"), myVariable?.[indexer]);

After:

stryMutAct_9fa48(\\"11\\") ? delete myVariable[indexer] : (stryCov_9fa48(\\"11\\"), delete myVariable?.[indexer]);

Fixes #4741

Don't place mutants inside a delete expression.

Before:

```js
delete stryMutAct_9fa48(\\"11\\") ? myVariable[indexer] : (stryCov_9fa48(\\"11\\"), delete myVariable?.[indexer]);
```

After:

```js
stryMutAct_9fa48(\\"11\\") ? delete myVariable[indexer] : (stryCov_9fa48(\\"11\\"), delete myVariable?.[indexer]);
```
@nicojs nicojs enabled auto-merge (squash) February 20, 2024 07:17
@nicojs nicojs disabled auto-merge February 20, 2024 07:34
@nicojs nicojs enabled auto-merge (squash) February 20, 2024 07:35
@nicojs nicojs merged commit 315087f into master Feb 20, 2024
14 checks passed
@nicojs nicojs deleted the fix/instrument-delete branch February 20, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Code is not modified correctly with delete variable?.[index] syntax
1 participant