Skip to content
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

In node 0.10, Map/Set size don't throw on Set/Map, respectively #272

Closed
ljharb opened this issue Jan 16, 2017 · 4 comments
Closed

In node 0.10, Map/Set size don't throw on Set/Map, respectively #272

ljharb opened this issue Jan 16, 2017 · 4 comments

Comments

@ljharb
Copy link

ljharb commented Jan 16, 2017

var setSize = Object.getOwnPropertyDescriptor(Set.prototype, 'size').get;
var mapSize = Object.getOwnPropertyDescriptor(Map.prototype, 'size').get;

setSize.call(new Set()); // 0
mapSize.call(new Map()); // 0

assert.throws(function () { setSize.call(new Map()); }); // should throw but does not
assert.throws(function () { mapSize.call(new Set()); }); // should throw but does not

This code passes on es6-shim, and in any engine with native Map/Set.

@ljharb
Copy link
Author

ljharb commented Mar 31, 2017

This is blocking expect and object-inspect, which affect a number of downstream projects. Any chance this could be looked at soon?

@ljharb
Copy link
Author

ljharb commented Jul 26, 2017

Thanks! What version will this be released in?

@zloirock
Copy link
Owner

@ljharb sorry for the delay. I wanna fix some more issues and test it, so seems 2.5.0 will be released after some days.

@ljharb
Copy link
Author

ljharb commented Jul 26, 2017

Sounds good, thanks! I'll keep an eye out for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants