fix: correctly transform __proto__ properties (#12664)
* fix: correctly transform `__proto__` properties * fixup! fix: correctly transform `__proto__` properties
This commit is contained in:
11
packages/babel-plugin-transform-computed-properties/test/fixtures/spec/proto-shorthand/input.js
vendored
Normal file
11
packages/babel-plugin-transform-computed-properties/test/fixtures/spec/proto-shorthand/input.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
var shorthand = {
|
||||
__proto__,
|
||||
}
|
||||
|
||||
var method = {
|
||||
__proto__() {}
|
||||
}
|
||||
|
||||
var methodComputed = {
|
||||
["__proto__"]() {}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"transform-computed-properties",
|
||||
"transform-shorthand-properties"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
var shorthand = babelHelpers.defineProperty({}, "__proto__", __proto__);
|
||||
var method = babelHelpers.defineProperty({}, "__proto__", function () {});
|
||||
var methodComputed = babelHelpers.defineProperty({}, "__proto__", function () {});
|
||||
3
packages/babel-plugin-transform-computed-properties/test/fixtures/spec/proto/input.js
vendored
Normal file
3
packages/babel-plugin-transform-computed-properties/test/fixtures/spec/proto/input.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var obj = {
|
||||
['__proto__']: 123
|
||||
};
|
||||
1
packages/babel-plugin-transform-computed-properties/test/fixtures/spec/proto/output.js
vendored
Normal file
1
packages/babel-plugin-transform-computed-properties/test/fixtures/spec/proto/output.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var obj = babelHelpers.defineProperty({}, '__proto__', 123);
|
||||
Reference in New Issue
Block a user