Fix source maps for private member expressions#16514
Merged
nicolo-ribaudo merged 6 commits intobabel:mainfrom May 20, 2024
Merged
Fix source maps for private member expressions#16514nicolo-ribaudo merged 6 commits intobabel:mainfrom
nicolo-ribaudo merged 6 commits intobabel:mainfrom
Conversation
nicolo-ribaudo
commented
May 19, 2024
Comment on lines
+9
to
+11
| babelHelpers.classPrivateFieldGet2(_field, this); | ||
| babelHelpers.classPrivateGetter(_A_brand, this, _get_getter); | ||
| babelHelpers.assertClassBrand(_A_brand, this, _method); |
Member
Author
There was a problem hiding this comment.
Previously _field, _get_getter and _method were unmapped. Now they are mapped to #field, #getter and #method of the member expression.
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56985 |
nicolo-ribaudo
commented
May 19, 2024
Comment on lines
+151
to
+172
| (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 |
Member
Author
There was a problem hiding this comment.
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.
JLHwung
approved these changes
May 19, 2024
liuxingbaoyu
approved these changes
May 20, 2024
Vylpes
pushed a commit
to Vylpes/random-bunny
that referenced
this pull request
Jun 10, 2024
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@babel/traverse](https://babel.dev/docs/en/next/babel-traverse) ([source](https://github.com/babel/babel)) | resolutions | patch | [`7.24.1` -> `7.24.7`](https://renovatebot.com/diffs/npm/@babel%2ftraverse/7.24.1/7.24.7) | --- ### Release Notes <details> <summary>babel/babel (@​babel/traverse)</summary> ### [`v7.24.7`](https://github.com/babel/babel/blob/HEAD/CHANGELOG.md#v7247-2024-06-05) [Compare Source](babel/babel@v7.24.6...v7.24.7) ##### 🐛 Bug Fix - `babel-node` - [#​16554](babel/babel#16554) Allow extra flags in babel-node ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - `babel-traverse` - [#​16522](babel/babel#16522) fix: incorrect `constantViolations` with destructuring ([@​liuxingbaoyu](https://github.com/liuxingbaoyu)) - `babel-helper-transform-fixture-test-runner`, `babel-plugin-proposal-explicit-resource-management` - [#​16524](babel/babel#16524) fix: Transform `using` in `switch` correctly ([@​liuxingbaoyu](https://github.com/liuxingbaoyu)) ##### 🏠 Internal - `babel-helpers`, `babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime` - [#​16525](babel/babel#16525) Delete unused array helpers ([@​blakewilson](https://github.com/blakewilson)) ### [`v7.24.6`](https://github.com/babel/babel/blob/HEAD/CHANGELOG.md#v7246-2024-05-24) [Compare Source](babel/babel@v7.24.5...v7.24.6) ##### 🐛 Bug Fix - `babel-helper-create-class-features-plugin`, `babel-plugin-transform-class-properties` - [#​16514](babel/babel#16514) Fix source maps for private member expressions ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - `babel-core`, `babel-generator`, `babel-plugin-transform-modules-commonjs` - [#​16515](babel/babel#16515) Fix source maps for template literals ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-decorators` - [#​16485](babel/babel#16485) Support undecorated static accessor in anonymous classes ([@​JLHwung](https://github.com/JLHwung)) - [#​16484](babel/babel#16484) Fix decorator bare yield await ([@​JLHwung](https://github.com/JLHwung)) - `babel-helpers`, `babel-plugin-proposal-decorators`, `babel-runtime-corejs3` - [#​16483](babel/babel#16483) Fix: throw TypeError if addInitializer is called after finished ([@​JLHwung](https://github.com/JLHwung)) - `babel-parser`, `babel-plugin-transform-typescript` - [#​16476](babel/babel#16476) fix: Correctly parse `cls.fn<C> = x` ([@​liuxingbaoyu](https://github.com/liuxingbaoyu)) ##### 🏠 Internal - `babel-core`, `babel-helpers`, `babel-plugin-transform-runtime`, `babel-preset-env`, `babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime` - [#​16501](babel/babel#16501) Generate helper metadata at build time ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - `babel-helpers` - [#​16499](babel/babel#16499) Add `tsconfig.json` for `@babel/helpers/src/helpers` ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - `babel-cli`, `babel-helpers`, `babel-plugin-external-helpers`, `babel-plugin-proposal-decorators`, `babel-plugin-transform-class-properties`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-modules-systemjs`, `babel-plugin-transform-runtime`, `babel-preset-env`, `babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime` - [#​16495](babel/babel#16495) Move all runtime helpers to individual files ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - `babel-parser`, `babel-traverse` - [#​16482](babel/babel#16482) Statically generate boilerplate for bitfield accessors ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - Other - [#​16466](babel/babel#16466) Migrate import assertions syntax ([@​JLHwung](https://github.com/JLHwung)) ### [`v7.24.5`](https://github.com/babel/babel/blob/HEAD/CHANGELOG.md#v7245-2024-04-29) [Compare Source](babel/babel@v7.24.1...v7.24.5) ##### 🐛 Bug Fix - `babel-plugin-transform-classes`, `babel-traverse` - [#​16377](babel/babel#16377) fix: TypeScript annotation affects output ([@​liuxingbaoyu](https://github.com/liuxingbaoyu)) - `babel-helpers`, `babel-plugin-proposal-explicit-resource-management`, `babel-runtime-corejs3` - [#​16440](babel/babel#16440) Fix suppressed error order ([@​sossost](https://github.com/sossost)) - [#​16408](babel/babel#16408) Await nullish async disposable ([@​JLHwung](https://github.com/JLHwung)) ##### 💅 Polish - `babel-parser` - [#​16407](babel/babel#16407) Recover from exported `using` declaration ([@​JLHwung](https://github.com/JLHwung)) ##### 🏠 Internal - Other - [#​16414](babel/babel#16414) Relax ESLint peerDependency constraint to allow v9 ([@​liuxingbaoyu](https://github.com/liuxingbaoyu)) - `babel-parser` - [#​16425](babel/babel#16425) Improve `@babel/parser` AST types ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - [#​16417](babel/babel#16417) Always pass type argument to `.startNode` ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - `babel-helper-create-class-features-plugin`, `babel-helper-member-expression-to-functions`, `babel-helper-module-transforms`, `babel-helper-split-export-declaration`, `babel-helper-wrap-function`, `babel-helpers`, `babel-plugin-bugfix-firefox-class-in-computed-class-key`, `babel-plugin-proposal-explicit-resource-management`, `babel-plugin-transform-block-scoping`, `babel-plugin-transform-destructuring`, `babel-plugin-transform-object-rest-spread`, `babel-plugin-transform-optional-chaining`, `babel-plugin-transform-parameters`, `babel-plugin-transform-private-property-in-object`, `babel-plugin-transform-react-jsx-self`, `babel-plugin-transform-typeof-symbol`, `babel-plugin-transform-typescript`, `babel-traverse` - [#​16439](babel/babel#16439) Make `NodePath<T | U>` distributive ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - `babel-plugin-proposal-partial-application`, `babel-types` - [#​16421](babel/babel#16421) Remove `JSXNamespacedName` from valid `CallExpression` args ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) - `babel-plugin-transform-class-properties`, `babel-preset-env` - [#​16406](babel/babel#16406) Do not load unnecessary Babel 7 syntax plugins in Babel 8 ([@​nicolo-ribaudo](https://github.com/nicolo-ribaudo)) ##### 🏃♀️ Performance - `babel-helpers`, `babel-preset-env`, `babel-runtime-corejs3` - [#​16357](babel/babel#16357) Performance: improve `objectWithoutPropertiesLoose` on V8 ([@​romgrk](https://github.com/romgrk)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Reviewed-on: https://git.vylpes.xyz/RabbitLabs/random-bunny/pulls/173 Co-authored-by: Renovate Bot <renovate@vylpes.com> Co-committed-by: Renovate Bot <renovate@vylpes.com>
This was referenced Jun 14, 2024
This was referenced Aug 19, 2024
This was referenced Aug 19, 2024
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1, Fixes #2