Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[setPublicClassFields] Use define for static
name
/length
- Loading branch information
1 parent
a7b1181
commit fcfaa05
Showing
3 changed files
with
54 additions
and
3 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
11 changes: 11 additions & 0 deletions
11
...-properties/test/fixtures/assumption-setPublicClassFields/length-name-use-define/input.js
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,11 @@ | ||
class A { | ||
static name = 1; | ||
static length = 2; | ||
static foo = 3; | ||
static [bar] = 4; | ||
static ["name"] = 5; | ||
static [name] = 6; | ||
|
||
name = 7; | ||
length = 8; | ||
} |
19 changes: 19 additions & 0 deletions
19
...properties/test/fixtures/assumption-setPublicClassFields/length-name-use-define/output.js
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,19 @@ | ||
let _bar, _name; | ||
|
||
_bar = bar; | ||
_name = name; | ||
|
||
class A { | ||
constructor() { | ||
this.name = 7; | ||
this.length = 8; | ||
} | ||
|
||
} | ||
|
||
babelHelpers.defineProperty(A, "name", 1); | ||
babelHelpers.defineProperty(A, "length", 2); | ||
A.foo = 3; | ||
A[_bar] = 4; | ||
babelHelpers.defineProperty(A, "name", 5); | ||
A[_name] = 6; |