get-own-property-symbols
Advanced tools
Comparing version 0.6.1 to 0.7.0
/*! (C) WebReflection Mit Style License */ | ||
(function(e,t){"use strict";if(t in e)return;var n,r=typeof global==typeof r?window:global,i=0,s=""+Math.random(),o="__symbol:",u=o.length,a="__symbol@@"+s,f="defineProperty",l="defineProperties",c="getOwnPropertyNames",h="getOwnPropertyDescriptor",p="propertyIsEnumerable",d=e[c],v=e[h],m=e.create,g=e.keys,y=e[f],b=e[l],w=v(e,c),E=e.prototype,S=E.hasOwnProperty,x=E[p],T=E.toString,N=Array.prototype.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},C=function(e,t,n){S.call(e,a)||y(e,a,{enumerable:!1,configurable:!1,writable:!1,value:{}}),e[a]["@@"+t]=n},k=function(e,t){var n=m(e);return d(t).forEach(function(e){_.call(t,e)&&F(n,e,t[e])}),n},L=function(e){var t=m(e);return t.enumerable=!1,t},A=function(){},O=function(e){return e!=a&&!S.call(H,e)},M=function(e){return e!=a&&S.call(H,e)},_=function R(e){var t=""+e;return M(t)?S.call(this,t)&&this[a]["@@"+t]:x.call(this,e)},D=function(t){var r={enumerable:!1,configurable:!0,get:A,set:function(e){n(this,t,{enumerable:!1,configurable:!0,writable:!0,value:e}),C(this,t,!0)}};return y(E,t,r),H[t]=y(e(t),"constructor",B)},P=function(t){if(this&&this!==r)throw new TypeError("Symbol is not a constructor");return D(o.concat(t||"",s,++i))},H=m(null),B={value:P},j=function(e){return H[e]},F=function(t,r,i){var s=""+r;return M(s)?(n(t,s,i.enumerable?L(i):i),C(t,s,!!i.enumerable)):y(t,r,i),t},I=function(t){return d(t).filter(M).map(j)};w.value=F,y(e,f,w),w.value=I,y(e,t,w),w.value=function(t){return d(t).filter(O)},y(e,c,w),w.value=function U(e,t){var n=I(t);return n.length?g(t).concat(n).forEach(function(n){_.call(t,n)&&F(e,n,t[n])}):U(e,t),e},y(e,l,w),w.value=_,y(E,p,w),w.value=P,y(r,"Symbol",w),w.value=function(e){var t=o.concat(o,e,s);return t in E?H[t]:D(t)},y(P,"for",w),w.value=function(e){return S.call(H,e)?e.slice(u*2,-s.length):void 0},y(P,"keyFor",w),w.value=function(t,n){var r=v(t,n);return r&&M(n)&&(r.enumerable=_.call(t,n)),r},y(e,h,w),w.value=function(e,t){return arguments.length===1?m(e):k(e,t)},y(e,"create",w);try{n=m(y({},o,{get:function(){return y(this,o,{value:!1})[o]}}))[o]||y}catch(q){n=function(e,t,n){var r=v(E,t);delete E[t],y(e,t,n),y(E,t,r)}}["iterator","match","replace","search","split","hasInstance","isConcatSpreadable","unscopables","species","toPrimitive","toStringTag"].forEach(function(e){y(P,e,{value:P(e)})}),y(E,"toString",{value:function z(){var e=T.call(this);return e==="[object String]"&&M(this)?"[object Symbol]":e}})})(Object,"getOwnPropertySymbols"),function(e,t,n){t[e]||(t[e]=function(){var e=0,t=this;return{next:function(){var r=t.length<=e;return r?{done:r}:{done:r,value:t[e++]}}}}),n[e]||(n[e]=function(){var e=String.fromCodePoint,t=this,n=0,r=t.length;return{next:function(){var o=r<=n,u=o?"":e(t.codePointAt(n));return n+=u.length,o?{done:o}:{done:o,value:u}}}})}(Symbol.iterator,Array.prototype,String.prototype); | ||
(function(e,t){"use strict";if(t in e)return;var n,r=typeof global==typeof r?window:global,i=0,s=""+Math.random(),o="__symbol:",u=o.length,a="__symbol@@"+s,f="defineProperty",l="defineProperties",c="getOwnPropertyNames",h="getOwnPropertyDescriptor",p="propertyIsEnumerable",d=e[c],v=e[h],m=e.create,g=e.keys,y=e[f],b=e[l],w=v(e,c),E=e.prototype,S=E.hasOwnProperty,x=E[p],T=E.toString,N=Array.prototype.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},C=function(e,t,n){S.call(e,a)||y(e,a,{enumerable:!1,configurable:!1,writable:!1,value:{}}),e[a]["@@"+t]=n},k=function(e,t){var n=m(e);return d(t).forEach(function(e){_.call(t,e)&&F(n,e,t[e])}),n},L=function(e){var t=m(e);return t.enumerable=!1,t},A=function(){},O=function(e){return e!=a&&!S.call(H,e)},M=function(e){return e!=a&&S.call(H,e)},_=function R(e){var t=""+e;return M(t)?S.call(this,t)&&this[a]["@@"+t]:x.call(this,e)},D=function(t){var r={enumerable:!1,configurable:!0,get:A,set:function(e){n(this,t,{enumerable:!1,configurable:!0,writable:!0,value:e}),C(this,t,!0)}};return y(E,t,r),H[t]=y(e(t),"constructor",B)},P=function(t){if(this&&this!==r)throw new TypeError("Symbol is not a constructor");return D(o.concat(t||"",s,++i))},H=m(null),B={value:P},j=function(e){return H[e]},F=function(t,r,i){var s=""+r;return M(s)?(n(t,s,i.enumerable?L(i):i),C(t,s,!!i.enumerable)):y(t,r,i),t},I=function(t){return d(t).filter(M).map(j)};w.value=F,y(e,f,w),w.value=I,y(e,t,w),w.value=function(t){return d(t).filter(O)},y(e,c,w),w.value=function U(e,t){var n=I(t);return n.length?g(t).concat(n).forEach(function(n){_.call(t,n)&&F(e,n,t[n])}):U(e,t),e},y(e,l,w),w.value=_,y(E,p,w),w.value=P,y(r,"Symbol",w),w.value=function(e){var t=o.concat(o,e,s);return t in E?H[t]:D(t)},y(P,"for",w),w.value=function(e){return S.call(H,e)?e.slice(u*2,-s.length):void 0},y(P,"keyFor",w),w.value=function(t,n){var r=v(t,n);return r&&M(n)&&(r.enumerable=_.call(t,n)),r},y(e,h,w),w.value=function(e,t){return arguments.length===1?m(e):k(e,t)},y(e,"create",w),w.value=function(){var e=T.call(this);return e==="[object String]"&&M(this)?"[object Symbol]":e},y(E,"toString",w);try{n=m(y({},o,{get:function(){return y(this,o,{value:!1})[o]}}))[o]||y}catch(q){n=function(e,t,n){var r=v(E,t);delete E[t],y(e,t,n),y(E,t,r)}}})(Object,"getOwnPropertySymbols"),function(e,t){var n=e.defineProperty,r=e.prototype,i=r.toString,s="toStringTag",o;["iterator","match","replace","search","split","hasInstance","isConcatSpreadable","unscopables","species","toPrimitive",s].forEach(function(t){if(!(t in Symbol)){n(Symbol,t,{value:Symbol(t)});switch(t){case s:o=e.getOwnPropertyDescriptor(r,"toString"),o.value,o.value=function(){var e=i.call(this),t=this[Symbol.toStringTag];return typeof t=="undefined"?e:"[object "+t+"]"},n(r,"toString",o)}}})}(Object,Symbol),function(e,t,n){t[e]||(t[e]=function(){var e=0,t=this;return{next:function(){var r=t.length<=e;return r?{done:r}:{done:r,value:t[e++]}}}}),n[e]||(n[e]=function(){var e=String.fromCodePoint,t=this,n=0,r=t.length;return{next:function(){var o=r<=n,u=o?"":e(t.codePointAt(n));return n+=u.length,o?{done:o}:{done:o,value:u}}}})}(Symbol.iterator,Array.prototype,String.prototype); |
@@ -52,3 +52,3 @@ /*! | ||
pIE = ObjectProto[PIE], | ||
asString = ObjectProto.toString, | ||
toString = ObjectProto.toString, | ||
indexOf = Array.prototype.indexOf || function (v) { | ||
@@ -214,2 +214,8 @@ for (var i = this.length; i-- && this[i] !== v;) {} | ||
descriptor.value = function () { | ||
var str = toString.call(this); | ||
return (str === '[object String]' && onlySymbols(this)) ? '[object Symbol]' : str; | ||
}; | ||
defineProperty(ObjectProto, 'toString', descriptor); | ||
try { // fails in few pre ES 5.1 engines | ||
@@ -236,2 +242,12 @@ setDescriptor = create( | ||
}(Object, 'getOwnPropertySymbols')); | ||
(function (O, S) { | ||
var | ||
dP = O.defineProperty, | ||
ObjectProto = O.prototype, | ||
toString = ObjectProto.toString, | ||
toStringTag = 'toStringTag', | ||
descriptor | ||
; | ||
[ | ||
@@ -248,17 +264,24 @@ 'iterator', // A method returning the default iterator for an object. Used by for...of. | ||
'toPrimitive', // A method converting an object to a primitive value. | ||
'toStringTag' // A string value used for the default description of an object. Used by Object.prototype.toString(). | ||
toStringTag // A string value used for the default description of an object. Used by Object.prototype.toString(). | ||
].forEach(function (name) { | ||
defineProperty(Symbol, name, {value: Symbol(name)}); | ||
}); | ||
defineProperty(ObjectProto, 'toString', { | ||
value: function toString() { | ||
var str = asString.call(this); | ||
return (str === '[object String]' && onlySymbols(this)) ? '[object Symbol]' : str; | ||
if (!(name in Symbol)) { | ||
dP(Symbol, name, {value: Symbol(name)}); | ||
switch (name) { | ||
case toStringTag: | ||
descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); | ||
descriptor.value; | ||
descriptor.value = function () { | ||
var | ||
str = toString.call(this), | ||
tst = this[Symbol.toStringTag] | ||
; | ||
return typeof tst === 'undefined' ? str : ('[object ' + tst + ']'); | ||
}; | ||
dP(ObjectProto, 'toString', descriptor); | ||
break; | ||
} | ||
} | ||
}); | ||
}(Object, Symbol)); | ||
}(Object, 'getOwnPropertySymbols')); | ||
(function (Si, AP, SP) { | ||
@@ -265,0 +288,0 @@ |
@@ -52,3 +52,3 @@ /*! | ||
pIE = ObjectProto[PIE], | ||
asString = ObjectProto.toString, | ||
toString = ObjectProto.toString, | ||
indexOf = Array.prototype.indexOf || function (v) { | ||
@@ -214,2 +214,8 @@ for (var i = this.length; i-- && this[i] !== v;) {} | ||
descriptor.value = function () { | ||
var str = toString.call(this); | ||
return (str === '[object String]' && onlySymbols(this)) ? '[object Symbol]' : str; | ||
}; | ||
defineProperty(ObjectProto, 'toString', descriptor); | ||
try { // fails in few pre ES 5.1 engines | ||
@@ -236,2 +242,12 @@ setDescriptor = create( | ||
}(Object, 'getOwnPropertySymbols')); | ||
(function (O, S) { | ||
var | ||
dP = O.defineProperty, | ||
ObjectProto = O.prototype, | ||
toString = ObjectProto.toString, | ||
toStringTag = 'toStringTag', | ||
descriptor | ||
; | ||
[ | ||
@@ -248,17 +264,24 @@ 'iterator', // A method returning the default iterator for an object. Used by for...of. | ||
'toPrimitive', // A method converting an object to a primitive value. | ||
'toStringTag' // A string value used for the default description of an object. Used by Object.prototype.toString(). | ||
toStringTag // A string value used for the default description of an object. Used by Object.prototype.toString(). | ||
].forEach(function (name) { | ||
defineProperty(Symbol, name, {value: Symbol(name)}); | ||
}); | ||
defineProperty(ObjectProto, 'toString', { | ||
value: function toString() { | ||
var str = asString.call(this); | ||
return (str === '[object String]' && onlySymbols(this)) ? '[object Symbol]' : str; | ||
if (!(name in Symbol)) { | ||
dP(Symbol, name, {value: Symbol(name)}); | ||
switch (name) { | ||
case toStringTag: | ||
descriptor = O.getOwnPropertyDescriptor(ObjectProto, 'toString'); | ||
descriptor.value; | ||
descriptor.value = function () { | ||
var | ||
str = toString.call(this), | ||
tst = this[Symbol.toStringTag] | ||
; | ||
return typeof tst === 'undefined' ? str : ('[object ' + tst + ']'); | ||
}; | ||
dP(ObjectProto, 'toString', descriptor); | ||
break; | ||
} | ||
} | ||
}); | ||
}(Object, Symbol)); | ||
}(Object, 'getOwnPropertySymbols')); | ||
(function (Si, AP, SP) { | ||
@@ -265,0 +288,0 @@ |
{ | ||
"version": "0.6.1", | ||
"version": "0.7.0", | ||
"license": "MIT", | ||
@@ -27,4 +27,4 @@ "name": "get-own-property-symbols", | ||
"devDependencies": { | ||
"wru": "~0.2.x" | ||
"wru": "*" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31376
595