Skip to content

Conversation

@0xe
Copy link
Contributor

@0xe 0xe commented Dec 12, 2025

Adds support for rest parameters in destructuring patterns (Object & Array).

The remaining failures in test262 from enabling "object-rest" are due to pending items with:

  • proxy support
  • async iterators
  • let & const

@0xe 0xe force-pushed the scratch/satish/dstr-support-rest-params branch 3 times, most recently from 9c9409f to 58b4fb0 Compare December 18, 2025 07:17
@0xe 0xe marked this pull request as ready for review December 18, 2025 07:19
@0xe 0xe force-pushed the scratch/satish/dstr-support-rest-params branch from 58b4fb0 to e7d8a82 Compare December 19, 2025 08:41
@gbrail
Copy link
Collaborator

gbrail commented Jan 1, 2026

This is great progress -- when you all get back to work, let me know if someone has time for a code review or if they're already OK with this.

@0xe 0xe force-pushed the scratch/satish/dstr-support-rest-params branch from e7d8a82 to d3a7ab0 Compare January 5, 2026 05:49
Copy link
Contributor

@aardvark179 aardvark179 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good, but I there's a big TODO list on the ScriptRuntime change, and byte code / class compilation seems complex in some ways we might avoid. I think it's worth seeing if we improve those areas.

out.println(tname + " \"" + str + '"');
break;
}
case Icode_OBJECT_REST:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like the way this byte code is structured, it's the first time we've had a code whose length depend on its data in this way, but I understand how you got there. How big a change would it be to restructure the two complex literal types in InterpreterData (regexes and template literals) as a single Object[] and put your data structure in that?

Edit: Ah, I see the class compiled version is doing the same sort of thing. Maybe this is the point to start moving this sort of complex data onto the JSDesccriptor and see if that helps tackle the big TODO in the ScriptRuntime change.

* @param excludeKeys array of property names to exclude
* @return a new object with all properties except the excluded ones
*/
// TODO - simplify:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a pretty big TODO list. 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed the problems in the TODO list. Will work on restructuring bytecode next.

@0xe
Copy link
Contributor Author

0xe commented Jan 6, 2026

Overall this looks good, but I there's a big TODO list on the ScriptRuntime change, and byte code / class compilation seems complex in some ways we might avoid. I think it's worth seeing if we improve those areas.

Thanks for the review. I'll work on addressing the items in the TODO list. I kinda left it for another day as this PR was already getting big. But, happy to address them. :)

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.

3 participants