-
Notifications
You must be signed in to change notification settings - Fork 385
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
Distinguish Set and Map iterators, with tests #437
Conversation
7c6322a
to
79d80a6
Compare
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.
Thanks!
test/set.js
Outdated
@@ -634,4 +634,22 @@ describe('Set', function () { | |||
|
|||
it.skip('should throw proper errors when user invokes methods with wrong types of receiver', function () { | |||
}); | |||
|
|||
it('SetIterator identification', 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.
we should conditionally skip this first test when Object.getPrototypeOf
is not available (in a separate it
; same in the Map tests)
Were there any change requests that I missed, or is there anything more to add for this? |
es6-shim.js
Outdated
@@ -2842,7 +2842,11 @@ | |||
}; | |||
|
|||
MapIterator.prototype = { | |||
isMapIterator: true, |
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.
it occurs to me that this is too easily forgeable; but that since instanceof
can't work cross-realm, this might be the best we can get.
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.
Can't think why anyone would want to forge it, but I also can't think of anything to make it more unforgeable.
fdf7c68
to
b1d9b84
Compare
Closes #387. Closes #391.