We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
new Iterator()
TypeError
The following assertion is included in the file /test/built-ins/Iterator/newtarget-or-active-function-object.js:
assert.throws(TypeError, () => { new Iterator(); });
Is this correct?
According to section 3.1.1.1 of the proposed specification 1,
it is designed to be subclassable. It may be used as the value of an extends clause of a class definition.
However, section 3.1.1.1.1 2 states:
Return ? OrdinaryCreateFromConstructor(NewTarget, "%Iterator.prototype%").
This does not mention throwing a TypeError.
Should a call to new Iterator() throw a TypeError, or should it return a value that inherits from Iterator.prototype?
Iterator.prototype
https://tc39.es/proposal-iterator-helpers/#sec-iterator-constructor ↩
https://tc39.es/proposal-iterator-helpers/#sec-iterator ↩
The text was updated successfully, but these errors were encountered:
When you do new Iterator, NewTarget and "the active function object" are equal (both Iterator) and so step 1 of 3.1.1.1.1 throws.
new Iterator
Iterator
Sorry, something went wrong.
Ahh I got it.., thanks
No branches or pull requests
The following assertion is included in the file /test/built-ins/Iterator/newtarget-or-active-function-object.js:
Is this correct?
According to section 3.1.1.1 of the proposed specification 1,
However, section 3.1.1.1.1 2 states:
This does not mention throwing a
TypeError
.Should a call to
new Iterator()
throw aTypeError
, or should it return a value that inherits fromIterator.prototype
?Footnotes
https://tc39.es/proposal-iterator-helpers/#sec-iterator-constructor ↩
https://tc39.es/proposal-iterator-helpers/#sec-iterator ↩
The text was updated successfully, but these errors were encountered: