Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correctly聽transform
__proto__
聽properties (#12664)
* fix: correctly聽transform `__proto__`聽properties * fixup! fix: correctly聽transform `__proto__`聽properties
- Loading branch information
Showing
9 changed files
with
52 additions
and
5 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
...es/babel-plugin-transform-computed-properties/test/fixtures/spec/proto-shorthand/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 @@ | ||
var shorthand = { | ||
__proto__, | ||
} | ||
|
||
var method = { | ||
__proto__() {} | ||
} | ||
|
||
var methodComputed = { | ||
["__proto__"]() {} | ||
} |
7 changes: 7 additions & 0 deletions
7
...abel-plugin-transform-computed-properties/test/fixtures/spec/proto-shorthand/options.json
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 @@ | ||
{ | ||
"plugins": [ | ||
"external-helpers", | ||
"transform-computed-properties", | ||
"transform-shorthand-properties" | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
...s/babel-plugin-transform-computed-properties/test/fixtures/spec/proto-shorthand/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,3 @@ | ||
var shorthand = babelHelpers.defineProperty({}, "__proto__", __proto__); | ||
var method = babelHelpers.defineProperty({}, "__proto__", function () {}); | ||
var methodComputed = babelHelpers.defineProperty({}, "__proto__", function () {}); |
3 changes: 3 additions & 0 deletions
3
packages/babel-plugin-transform-computed-properties/test/fixtures/spec/proto/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,3 @@ | ||
var obj = { | ||
['__proto__']: 123 | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/babel-plugin-transform-computed-properties/test/fixtures/spec/proto/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 @@ | ||
var obj = babelHelpers.defineProperty({}, '__proto__', 123); |
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
...l-plugin-transform-shorthand-properties/test/fixtures/shorthand-properties/proto/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,7 @@ | ||
var shorthand = { | ||
__proto__, | ||
} | ||
|
||
var method = { | ||
__proto__() {} | ||
} |
6 changes: 6 additions & 0 deletions
6
...-plugin-transform-shorthand-properties/test/fixtures/shorthand-properties/proto/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,6 @@ | ||
var shorthand = { | ||
["__proto__"]: __proto__ | ||
}; | ||
var method = { | ||
["__proto__"]: function () {} | ||
}; |