-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
Symbol()
should be a primitive by spec, and should not be `instance…
…of Symbol`
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ module.exports = function hasSymbols() { | |
var obj = {}; | ||
var sym = Symbol('test'); | ||
if (typeof sym === 'string') { return false; } | ||
if (sym instanceof Symbol) { return false; } | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ljharb
Author
Owner
|
||
obj[sym] = 42; | ||
for (sym in obj) { return false; } | ||
if (keys(obj).length !== 0) { return false; } | ||
|
Interesting :) It added for disable support
core-js
? Why not added alsoObject(Symbol()) instanceof Symbol
? :)