-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix source maps for private member expressions #16514
Fix source maps for private member expressions #16514
Conversation
babelHelpers.classPrivateFieldGet2(_field, this); | ||
babelHelpers.classPrivateGetter(_A_brand, this, _get_getter); | ||
babelHelpers.assertClassBrand(_A_brand, this, _method); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously _field
, _get_getter
and _method
were unmapped. Now they are mapped to #field
, #getter
and #method
of the member expression.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56985 |
(13:10-16) Expr(this.#fie <-- (12:10-11) Expr(babe | ||
^^^^^^ ^ | ||
(13:10-11) Expr(this <-- (12:10-11) Expr(babe | ||
^ ^ | ||
|
||
(13:10-16) Expr(this.#fie <-- (12:11-23) xpr(babelHelpers.cla | ||
^^^^^^ ^^^^^^^^^^^^ | ||
(13:11-16) xpr(this.#fie <-- (12:11-23) xpr(babelHelpers.cla | ||
^^^^^ ^^^^^^^^^^^^ | ||
|
||
(13:10-16) Expr(this.#fie <-- (12:23-24) pers.clas | ||
^^^^^^ ^ | ||
(13:11-16) xpr(this.#fie <-- (12:23-24) pers.clas | ||
^^^^^ ^ | ||
|
||
(13:10-16) Expr(this.#fie <-- (12:24-45) ers.classPrivateFieldGet2(_fi | ||
^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ | ||
(13:11-16) xpr(this.#fie <-- (12:24-45) ers.classPrivateFieldGet2(_fi | ||
^^^^^ ^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
(13:10-16) Expr(this.#fie <-- (12:45-46) Get2(_fie | ||
^^^^^^ ^ | ||
(13:11-16) xpr(this.#fie <-- (12:45-46) Get2(_fie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another fix. Previously, babelHelpers.classPrivateFieldGet2...
had no loc info so it was merged with the previous token (in this example, the (
of inExpr(
).
Now it's a bit weird that the closing paren of the babelHelpers.classPrivateFieldGet2
call is mapped to the last character of the private name, but in practice it's ok since no error or breakpoint will ever point to it.
Fixes #1, Fixes #2