-
Notifications
You must be signed in to change notification settings - Fork 179
Make Iterator.from spec compliant #689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -42,14 +42,6 @@ test262/test/built-ins/Date/prototype/setUTCMonth/date-value-read-before-tonumbe | |||
test262/test/built-ins/Date/prototype/setUTCMonth/date-value-read-before-tonumber-when-date-is-invalid.js:26: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true | |||
test262/test/built-ins/Date/prototype/setUTCSeconds/date-value-read-before-tonumber-when-date-is-invalid.js:26: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true | |||
test262/test/built-ins/Date/prototype/setUTCSeconds/date-value-read-before-tonumber-when-date-is-invalid.js:26: strict mode: Test262Error: time updated in valueOf Expected SameValue(«NaN», «0») to be true | |||
test262/test/built-ins/Iterator/from/get-return-method-when-call-return.js:24: TypeError: not a function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were the new ones after the test262 update. There are a couple of more failures below in weird property access, but as of this PR Iterator.from is non-ghetto :-P
quickjs.c
Outdated
@@ -40053,24 +40057,95 @@ static JSValue js_array_iterator_next(JSContext *ctx, JSValue this_val, | |||
} | |||
} | |||
|
|||
typedef struct JSIteratorData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bnoordhuis Let me know what you think of this approach, I couldn't find a way around not having extra stored state.
Doh, I'm an idiot. Looks like we do need a new class because after fixing the prototype whoes I cannot make test262/test/built-ins/Iterator/from/result-proto.js pass. New class it is! |
2bc339f
to
fb20577
Compare
Updated, PTAL! Note it includes #690 |
Create a proper wrapper around the inner iterator and proxy the calls to next / return.
1f23f6e
to
ca878d4
Compare
Create a proper wrapper around the inner iterator and proxy the calls to next / return.