Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proper feature call isLoose function #9424
- Loading branch information
1 parent
ff04d35
commit 3aaafae
Showing
7 changed files
with
51 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
5 changes: 5 additions & 0 deletions
5
...-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-false/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 X { | ||
#privateMethod() { | ||
return 42; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...ss-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-false/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,5 @@ | ||
{ | ||
"plugins": [ | ||
["proposal-private-methods", { "loose": false }] | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
...class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-false/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,12 @@ | ||
class X { | ||
constructor() { | ||
_privateMethod.add(this); | ||
} | ||
|
||
} | ||
|
||
var _privateMethod = new WeakSet(); | ||
|
||
var _privateMethod2 = function _privateMethod2() { | ||
return 42; | ||
}; |
5 changes: 5 additions & 0 deletions
5
...e-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-true/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 X { | ||
#privateMethod() { | ||
return 42; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...ass-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-true/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,5 @@ | ||
{ | ||
"plugins": [ | ||
["proposal-private-methods", { "loose": true }] | ||
] | ||
} |
18 changes: 18 additions & 0 deletions
18
...-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-true/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,18 @@ | ||
var id = 0; | ||
|
||
function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; } | ||
|
||
class X { | ||
constructor() { | ||
Object.defineProperty(this, _privateMethod, { | ||
value: _privateMethod2 | ||
}); | ||
} | ||
|
||
} | ||
|
||
var _privateMethod = _classPrivateFieldLooseKey("privateMethod"); | ||
|
||
var _privateMethod2 = function _privateMethod2() { | ||
return 42; | ||
}; |