-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f441b60
commit 48ed730
Showing
16 changed files
with
122 additions
and
1 deletion.
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
5 changes: 5 additions & 0 deletions
5
...test/fixtures/loose-class-features-precedence/methods-loose-preset-not-loose-win/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,5 @@ | ||
class A { | ||
x = 2; | ||
|
||
#foo() {} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../fixtures/loose-class-features-precedence/methods-loose-preset-not-loose-win/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,13 @@ | ||
{ | ||
"os": ["win32"], | ||
"validateLogs": true, | ||
"presets": [ | ||
["env", { | ||
"targets": { "node": 10 }, | ||
"shippedProposals": true | ||
}] | ||
], | ||
"plugins": [ | ||
["proposal-private-methods", { "loose": true }] | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
...est/fixtures/loose-class-features-precedence/methods-loose-preset-not-loose-win/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,17 @@ | ||
var id = 0; | ||
|
||
function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; } | ||
|
||
var _foo = _classPrivateFieldLooseKey("foo"); | ||
|
||
class A { | ||
constructor() { | ||
Object.defineProperty(this, _foo, { | ||
value: _foo2 | ||
}); | ||
this.x = 2; | ||
} | ||
|
||
} | ||
|
||
var _foo2 = function _foo2() {}; |
5 changes: 5 additions & 0 deletions
5
...st/fixtures/loose-class-features-precedence/methods-loose-preset-not-loose-win/stderr.txt
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,5 @@ | ||
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-class-properties since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-methods. | ||
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding | ||
["@babel/plugin-proposal-class-properties", { "loose": true }] | ||
to the "plugins" section of your Babel config. | ||
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR=<CWD>\packages\babel-preset-env\test\fixtures\loose-class-features-precedence\methods-loose-preset-not-loose\input.js environment variable to show the loaded configuration. |
1 change: 1 addition & 0 deletions
1
...test/fixtures/loose-class-features-precedence/methods-loose-preset-not-loose/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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"os": ["darwin", "linux"], | ||
"validateLogs": true, | ||
"presets": [ | ||
["env", { | ||
|
5 changes: 5 additions & 0 deletions
5
...t/fixtures/loose-class-features-precedence/properties-loose-preset-not-loose-win/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,5 @@ | ||
class A { | ||
x = 2; | ||
|
||
#foo() {} | ||
} |
13 changes: 13 additions & 0 deletions
13
...xtures/loose-class-features-precedence/properties-loose-preset-not-loose-win/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,13 @@ | ||
{ | ||
"os": ["win32"], | ||
"validateLogs": true, | ||
"presets": [ | ||
["env", { | ||
"targets": { "node": 10 }, | ||
"shippedProposals": true | ||
}] | ||
], | ||
"plugins": [ | ||
["proposal-class-properties", { "loose": true }] | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
.../fixtures/loose-class-features-precedence/properties-loose-preset-not-loose-win/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,17 @@ | ||
var id = 0; | ||
|
||
function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; } | ||
|
||
var _foo = _classPrivateFieldLooseKey("foo"); | ||
|
||
class A { | ||
constructor() { | ||
Object.defineProperty(this, _foo, { | ||
value: _foo2 | ||
}); | ||
this.x = 2; | ||
} | ||
|
||
} | ||
|
||
var _foo2 = function _foo2() {}; |
5 changes: 5 additions & 0 deletions
5
...fixtures/loose-class-features-precedence/properties-loose-preset-not-loose-win/stderr.txt
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,5 @@ | ||
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-methods since the "loose" mode option was set to "true" for @babel/plugin-proposal-class-properties. | ||
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding | ||
["@babel/plugin-proposal-private-methods", { "loose": true }] | ||
to the "plugins" section of your Babel config. | ||
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR=<CWD>\packages\babel-preset-env\test\fixtures\loose-class-features-precedence\properties-loose-preset-not-loose\input.js environment variable to show the loaded configuration. |
1 change: 1 addition & 0 deletions
1
...t/fixtures/loose-class-features-precedence/properties-loose-preset-not-loose/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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"os": ["darwin", "linux"], | ||
"validateLogs": true, | ||
"presets": [ | ||
["env", { | ||
|
5 changes: 5 additions & 0 deletions
5
...t/fixtures/loose-class-features-precedence/properties-not-loose-preset-loose-win/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,5 @@ | ||
class A { | ||
x = 2; | ||
|
||
#foo() {} | ||
} |
14 changes: 14 additions & 0 deletions
14
...xtures/loose-class-features-precedence/properties-not-loose-preset-loose-win/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,14 @@ | ||
{ | ||
"os": ["win32"], | ||
"validateLogs": true, | ||
"presets": [ | ||
["env", { | ||
"targets": { "node": 10 }, | ||
"shippedProposals": true, | ||
"loose": true | ||
}] | ||
], | ||
"plugins": [ | ||
["proposal-class-properties", { "loose": false }] | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
.../fixtures/loose-class-features-precedence/properties-not-loose-preset-loose-win/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,14 @@ | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
|
||
var _foo = new WeakSet(); | ||
|
||
class A { | ||
constructor() { | ||
_foo.add(this); | ||
|
||
_defineProperty(this, "x", 2); | ||
} | ||
|
||
} | ||
|
||
var _foo2 = function _foo2() {}; |
5 changes: 5 additions & 0 deletions
5
...fixtures/loose-class-features-precedence/properties-not-loose-preset-loose-win/stderr.txt
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,5 @@ | ||
Though the "loose" option was set to "true" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-methods since the "loose" mode option was set to "false" for @babel/plugin-proposal-class-properties. | ||
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding | ||
["@babel/plugin-proposal-private-methods", { "loose": false }] | ||
to the "plugins" section of your Babel config. | ||
You can re-run Babel with the BABEL_SHOW_CONFIG_FOR=<CWD>\packages\babel-preset-env\test\fixtures\loose-class-features-precedence\properties-not-loose-preset-loose\input.js environment variable to show the loaded configuration. |
1 change: 1 addition & 0 deletions
1
...t/fixtures/loose-class-features-precedence/properties-not-loose-preset-loose/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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"os": ["darwin", "linux"], | ||
"validateLogs": true, | ||
"presets": [ | ||
["env", { | ||
|