Comparing version 1.0.1 to 1.1.0
"use strict"; | ||
var _defineProperty = function (obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); }; | ||
var globalSymbolRegistryList = {}; | ||
@@ -24,2 +22,12 @@ | ||
var supportsAccessors = undefined; | ||
try { | ||
var x = defProp({}, "y", { get: function () { | ||
return 1; | ||
} }); | ||
supportsAccessors = x.y === 1; | ||
} catch (e) { | ||
supportsAccessors = false; | ||
} | ||
var id = {}; | ||
@@ -37,11 +45,14 @@ var uid = function (desc) { | ||
// Make the symbols hidden to pre-es6 code | ||
defProp(Object.prototype, tag, { | ||
get: undefined, | ||
set: function (value) { | ||
defProp(this, tag, defValue(value, { c: true, w: true })); | ||
}, | ||
configurable: true, | ||
enumerable: false | ||
}); | ||
/* istanbul ignore else */ | ||
if (supportsAccessors) { | ||
// Make the symbols hidden to pre-es6 code | ||
defProp(Object.prototype, tag, { | ||
get: undefined, | ||
set: function (value) { | ||
defProp(this, tag, defValue(value, { c: true, w: true })); | ||
}, | ||
configurable: true, | ||
enumerable: false | ||
}); | ||
} | ||
@@ -129,19 +140,9 @@ return tag; | ||
defProps(SymbolProto, (function () { | ||
var _defProps = {}; | ||
// 19.4.3.5 | ||
/* istanbul ignore else */ | ||
if (supportsAccessors) { | ||
defProp(SymbolProto, xSymbol.toStringTag, defValue("Symbol", { c: true })); | ||
} | ||
_defineProperty(_defProps, xSymbol.toPrimitive, defValue(function (hint) { | ||
return this; | ||
}, { c: true })); | ||
_defineProperty(_defProps, xSymbol.toStringTag, defValue("Symbol", { c: true })); | ||
return _defProps; | ||
})()); | ||
module.exports = typeof Symbol === "function" ? Symbol : xSymbol; | ||
// 19.4.3.4 XXX Does not follow spec. | ||
// 19.4.3.5 | ||
{ | ||
"name": "es-symbol", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "A spec-compliant as much as it could be, small, and tested ES6 Symbol implementation.", | ||
@@ -5,0 +5,0 @@ "main": "dist/symbol.js", |
10646
7
321