-
-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(transformer/class-properties): unwrap failed when private field e…
…xpression doesn't contain optional expression in ChainExpression
- Loading branch information
1 parent
6fa6785
commit 6613461
Showing
4 changed files
with
34 additions
and
16 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
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
6 changes: 6 additions & 0 deletions
6
...rm-class-properties/test/fixtures/private-optional-call-with-non-optional-callee/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,6 @@ | ||
class A { | ||
#a = {}; | ||
method() { | ||
this.#a.get(message.id)?.(message); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...m-class-properties/test/fixtures/private-optional-call-with-non-optional-callee/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,9 @@ | ||
var _a = /*#__PURE__*/ new WeakMap(); | ||
class A { | ||
constructor() { | ||
babelHelpers.classPrivateFieldInitSpec(this, _a, {}); | ||
} | ||
method() { | ||
babelHelpers.classPrivateFieldGet2(_a, this).get(message.id)?.(message); | ||
} | ||
} |