Skip to content

Implement new.target.#2335

Draft
aardvark179 wants to merge 37 commits into
mozilla:masterfrom
aardvark179:aardvark179-new-target
Draft

Implement new.target.#2335
aardvark179 wants to merge 37 commits into
mozilla:masterfrom
aardvark179:aardvark179-new-target

Conversation

@aardvark179

Copy link
Copy Markdown
Contributor

This PR stacks on top of #2334 and adds the following commits:
Implement runtime semantics of new target.
Expose new.target in the language.
Enable new.target in 262 tests.

Now that almost every built in function is converted over to the new JSDescriptor and JSCode model we can pass new.target easily to both built in and JS functions, so it seems like the right moment to implement that and expose this at the JS level.

@aardvark179 aardvark179 force-pushed the aardvark179-new-target branch 3 times, most recently from 3cae341 to ddbe007 Compare March 16, 2026 17:46
@aardvark179 aardvark179 force-pushed the aardvark179-new-target branch 4 times, most recently from 7af8644 to b13bdc1 Compare March 19, 2026 21:50
@aardvark179 aardvark179 force-pushed the aardvark179-new-target branch 7 times, most recently from 5843f08 to 6876342 Compare March 30, 2026 09:40
@aardvark179 aardvark179 force-pushed the aardvark179-new-target branch 4 times, most recently from a38d362 to a337002 Compare April 3, 2026 20:47
@aardvark179 aardvark179 force-pushed the aardvark179-new-target branch from a337002 to f37e500 Compare April 30, 2026 11:42
@aardvark179 aardvark179 force-pushed the aardvark179-new-target branch 3 times, most recently from 495013f to 0ce3390 Compare May 9, 2026 19:52
@aardvark179 aardvark179 force-pushed the aardvark179-new-target branch from 0ce3390 to 760f30e Compare May 12, 2026 09:48
@gbrail

gbrail commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Now that we refactored anything else, how much work is it to get this (and the class work) rebased on the latest branches?

@aardvark179

Copy link
Copy Markdown
Contributor Author

I'd like to get interpreter V2 in before this so that we can reduce the difference in our fork. I was hopping to get some help turning the PoC stuff into better production code, but we've been stretched a bit thin by other stuff. Rebasing that onto V2 has been helpful in working out how to improve that.

@aardvark179

Copy link
Copy Markdown
Contributor Author

The interpreter V2 and class prototyping work made me rethink a couple of aspects of this change, and I think I've now got it in a better place. There was one thing round bound functions that worked more by luck than judgement, and I found myself duplicating more code round new compilation, super constructor calls, and Reflect.construct than felt right. I'll push a new version of this branch tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants