-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(string-literal-mutator): don't mutate class property keys (#2544)
Don't mutate class property keys that are written as a string literal. ```ts class Foo { 'bar-baz': 4 // don't mutate } ```
- Loading branch information
Showing
5 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/instrumenter/testResources/instrumenter/string-mutations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require('foo'); // no mutation | ||
import 'foo'; // no mutation | ||
|
||
class Foo { | ||
public 'bar-baz': string; // no mutation | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
packages/instrumenter/testResources/instrumenter/string-mutations.ts.out.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`instrumenter integration should be able to instrument string literals in different places 1`] = ` | ||
"require('foo'); // no mutation | ||
import 'foo'; // no mutation | ||
class Foo { | ||
public 'bar-baz': string; // no mutation | ||
}" | ||
`; |