es6-symbol
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -5,5 +5,2 @@ // Exports true if environment provides native `Symbol` implementation | ||
module.exports = (function () { | ||
if (typeof Symbol !== 'function') return false; | ||
return (typeof Symbol() === 'symbol'); | ||
}()); | ||
module.exports = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; |
{ | ||
"name": "es6-symbol", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "ECMAScript 6 Symbol polyfill", | ||
@@ -21,7 +21,7 @@ "author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)", | ||
"dependencies": { | ||
"d": "~0.1.1", | ||
"es5-ext": "~0.10.11" | ||
"d": "1", | ||
"es5-ext": "~0.10.14" | ||
}, | ||
"devDependencies": { | ||
"tad": "~0.2.4", | ||
"tad": "~0.2.7", | ||
"xlint": "~0.2.2", | ||
@@ -28,0 +28,0 @@ "xlint-jslint-medikoo": "~0.1.4" |
@@ -1,2 +0,2 @@ | ||
// ES2015 Symbol polyfill for environments that do not support it (or partially support it) | ||
// ES2015 Symbol polyfill for environments that do not (or partially) support it | ||
@@ -46,3 +46,3 @@ 'use strict'; | ||
HiddenSymbol = function Symbol(description) { | ||
if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor'); | ||
if (this instanceof HiddenSymbol) throw new TypeError('Symbol is not a constructor'); | ||
return SymbolPolyfill(description); | ||
@@ -55,3 +55,3 @@ }; | ||
var symbol; | ||
if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); | ||
if (this instanceof Symbol) throw new TypeError('Symbol is not a constructor'); | ||
if (isNativeSafe) return NativeSymbol(description); | ||
@@ -76,4 +76,4 @@ symbol = create(HiddenSymbol.prototype); | ||
// If there's native implementation of given symbol, let's fallback to it | ||
// to ensure proper interoperability with other native functions e.g. Array.from | ||
// To ensure proper interoperability with other native functions (e.g. Array.from) | ||
// fallback to eventual native implementation of given symbol | ||
hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')), | ||
@@ -80,0 +80,0 @@ isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) || |
@@ -15,3 +15,3 @@ # es6-symbol | ||
It’s safest to use *es6-symbol* as a [ponyfill](http://kikobeats.com/polyfill-ponyfill-and-prollyfill/) – a polyfill which doesn’t touch global objects: | ||
If you'd like to use native version when it exists and fallback to [ponyfill](https://ponyfill.com) if it doesn't, use *es6-symbol* as following: | ||
@@ -18,0 +18,0 @@ ```javascript |
Sorry, the diff of this file is not supported yet
15328
224
- Removedd@0.1.1(transitive)
Updatedd@1
Updatedes5-ext@~0.10.14