Skip to content

Improve super.x output#16374

Merged
liuxingbaoyu merged 11 commits intobabel:mainfrom
liuxingbaoyu:super.prop
Jul 23, 2024
Merged

Improve super.x output#16374
liuxingbaoyu merged 11 commits intobabel:mainfrom
liuxingbaoyu:super.prop

Conversation

@liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Mar 21, 2024

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

I personally don't like having to call getPrototypeOf every time because it's slow, but we have a test that relies on this behavior.
image

@babel-bot
Copy link
Collaborator

babel-bot commented Mar 21, 2024

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57350

@liuxingbaoyu liuxingbaoyu marked this pull request as draft March 22, 2024 00:36
@liuxingbaoyu liuxingbaoyu marked this pull request as ready for review March 22, 2024 01:14
@liuxingbaoyu liuxingbaoyu added the PR: Output optimization 🔬 A type of pull request used for our changelog categories label Mar 22, 2024
@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Jun 21, 2024

Finally reviewing this, sorry it took so long.

I personally don't like having to call getPrototypeOf every time because it's slow, but we have a test that relies on this behavior.

This is covered by the constantSuper assumption, right?


Can you add a test for the execution order between property access and arguments evaluation?

let argsEval = false;
let err = {};

class A {
  get x() { throw {} }
}

class B extends A {
  method() {
    super.x(argsEval = true);
  }
}

expect(() => new B().method()).toThrow(err);
expect(argsEval).toBe(false);

@liuxingbaoyu liuxingbaoyu force-pushed the super.prop branch 2 times, most recently from dd1bc89 to 92e2168 Compare June 25, 2024 06:34
@liuxingbaoyu liuxingbaoyu force-pushed the super.prop branch 2 times, most recently from 9c609ac to 8cb4293 Compare July 13, 2024 09:41
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 22, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Output optimization 🔬 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants