Implement Promise.allKeyed, Promise.allSettledKeyed.#330
Implement Promise.allKeyed, Promise.allSettledKeyed.#330Jack-Works merged 9 commits intoengine262:mainfrom
Conversation
src/intrinsics/Promise.mts
Outdated
|
|
||
| /** https://tc39.es/proposal-await-dictionary/#sec-promise.allkeyed */ | ||
| function* Promise_allKeyed([promises = Value.undefined]: Arguments, { thisValue }: FunctionCallContext): ValueEvaluator { | ||
| // 1. Let C be the this value. |
There was a problem hiding this comment.
Hi! I would prefer to remove spec steps if they're very straitforward.
For example I will keep comments like this:
// 1. If an implementation-defined debugging facility is available and enabled, then // 1. If StringToCodePoints(text) is not a valid JSON text as specified in ECMA-404, throw a SyntaxError exception.
Q(JSONValidator.validate(text));There was a problem hiding this comment.
I know... I have this bad habit of being robotic, trying to capture everything as written, when it comes to the specs.
|
Hi, I just pushed a big commit, if you have difficulties with merging plz let me know |
Uncaught TypeError: Cannot destructure property 'Agent' of 'self.@engine262/engine262' as it is undefined. |
Hi I cannot reproduce this on my side, have you update the submodule ( |
src/intrinsics/Promise.mts
Outdated
|
|
||
| // 7. Return undefined. | ||
| return Value.undefined; | ||
| })(index); |
There was a problem hiding this comment.
This looks like a spec bug. Spec capture should not (at least no precedence, as I can recall) capture a variable (only constants).
You can raise an issue in the proposal.
|
Hi! Please revert your changes on |
This was an unintended change. I'm trying to find the time to do the necessary cleanup. |
Co-authored-by: Jack Works <5390719+Jack-Works@users.noreply.github.com>
Smoketest on
npm run inspector:I was getting reasonable results when I tweaked this for all promises resolving, and for allSettled instead of allSettledKeyed.
As directed, this is behind a feature flag. Nice that
npm run inspectorpicked up on it automatically.