get-own-property-symbols
Advanced tools
Comparing version 0.9.2 to 0.9.3
/*! (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.freeze||e,b=e[f],w=e[l],E=v(e,c),S=e.prototype,x=S.hasOwnProperty,T=S[p],N=S.toString,C=Array.prototype.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},k=function(e,t,n){x.call(e,a)||b(e,a,{enumerable:!1,configurable:!1,writable:!1,value:{}}),e[a]["@@"+t]=n},L=function(e,t){var n=m(e);return d(t).forEach(function(e){D.call(t,e)&&I(n,e,t[e])}),n},A=function(e){var t=m(e);return t.enumerable=!1,t},O=function(){},M=function(e){return e!=a&&!x.call(B,e)},_=function(e){return e!=a&&x.call(B,e)},D=function U(e){var t=""+e;return _(t)?x.call(this,t)&&this[a]["@@"+t]:T.call(this,e)},P=function(t){var r={enumerable:!1,configurable:!0,get:O,set:function(e){n(this,t,{enumerable:!1,configurable:!0,writable:!0,value:e}),k(this,t,!0)}};return b(S,t,r),y(B[t]=b(e(t),"constructor",j))},H=function(t){if(this&&this!==r)throw new TypeError("Symbol is not a constructor");return P(o.concat(t||"",s,++i))},B=m(null),j={value:H},F=function(e){return B[e]},I=function(t,r,i){var s=""+r;return _(s)?(n(t,s,i.enumerable?A(i):i),k(t,s,!!i.enumerable)):b(t,r,i),t},q=function(t){return d(t).filter(_).map(F)};E.value=I,b(e,f,E),E.value=q,b(e,t,E),E.value=function(t){return d(t).filter(M)},b(e,c,E),E.value=function(t,n){var r=q(n);return r.length?g(n).concat(r).forEach(function(e){D.call(n,e)&&I(t,e,n[e])}):w(t,n),t},b(e,l,E),E.value=D,b(S,p,E),E.value=H,b(r,"Symbol",E),E.value=function(e){var t=o.concat(o,e,s);return t in S?B[t]:P(t)},b(H,"for",E),E.value=function(e){if(M(e))throw new TypeError(e+" is not a symbol");return x.call(B,e)?e.slice(u*2,-s.length):void 0},b(H,"keyFor",E),E.value=function(t,n){var r=v(t,n);return r&&_(n)&&(r.enumerable=D.call(t,n)),r},b(e,h,E),E.value=function(e,t){return arguments.length===1?m(e):L(e,t)},b(e,"create",E),E.value=function(){var e=N.call(this);return e==="[object String]"&&_(this)?"[object Symbol]":e},b(S,"toString",E);try{n=m(b({},o,{get:function(){return b(this,o,{value:!1})[o]}}))[o]||b}catch(R){n=function(e,t,n){var r=v(S,t);delete S[t],b(e,t,n),b(S,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=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){function r(){return this}t[e]||(t[e]=function(){var t=0,n=this,i={next:function(){var r=n.length<=t;return r?{done:r}:{done:r,value:n[t++]}}};return i[e]=r,i}),n[e]||(n[e]=function(){var t=String.fromCodePoint,n=this,i=0,s=n.length,o={next:function(){var r=s<=i,o=r?"":t(n.codePointAt(i));return i+=o.length,r?{done:r}:{done:r,value:o}}};return o[e]=r,o})}(Symbol.iterator,Array.prototype,String.prototype); | ||
(function(Object,GOPS){"use strict";if(GOPS in Object)return;var setDescriptor,G=typeof global===typeof G?window:global,id=0,random=""+Math.random(),prefix="__symbol:",prefixLength=prefix.length,internalSymbol="__symbol@@"+random,DP="defineProperty",DPies="defineProperties",GOPN="getOwnPropertyNames",GOPD="getOwnPropertyDescriptor",PIE="propertyIsEnumerable",gOPN=Object[GOPN],gOPD=Object[GOPD],create=Object.create,keys=Object.keys,freeze=Object.freeze||Object,defineProperty=Object[DP],$defineProperties=Object[DPies],descriptor=gOPD(Object,GOPN),ObjectProto=Object.prototype,hOP=ObjectProto.hasOwnProperty,pIE=ObjectProto[PIE],toString=ObjectProto.toString,addInternalIfNeeded=function(o,uid,enumerable){if(!hOP.call(o,internalSymbol)){defineProperty(o,internalSymbol,{enumerable:false,configurable:false,writable:false,value:{}})}o[internalSymbol]["@@"+uid]=enumerable},createWithSymbols=function(proto,descriptors){var self=create(proto);gOPN(descriptors).forEach(function(key){if(propertyIsEnumerable.call(descriptors,key)){$defineProperty(self,key,descriptors[key])}});return self},copyAsNonEnumerable=function(descriptor){var newDescriptor=create(descriptor);newDescriptor.enumerable=false;return newDescriptor},get=function get(){},onlyNonSymbols=function(name){return name!=internalSymbol&&!hOP.call(source,name)},onlySymbols=function(name){return name!=internalSymbol&&hOP.call(source,name)},propertyIsEnumerable=function propertyIsEnumerable(key){var uid=""+key;return onlySymbols(uid)?hOP.call(this,uid)&&this[internalSymbol]["@@"+uid]:pIE.call(this,key)},setAndGetSymbol=function(uid){var descriptor={enumerable:false,configurable:true,get:get,set:function(value){setDescriptor(this,uid,{enumerable:false,configurable:true,writable:true,value:value});addInternalIfNeeded(this,uid,true)}};defineProperty(ObjectProto,uid,descriptor);return freeze(source[uid]=defineProperty(Object(uid),"constructor",sourceConstructor))},Symbol=function Symbol(description){if(this&&this!==G){throw new TypeError("Symbol is not a constructor")}return setAndGetSymbol(prefix.concat(description||"",random,++id))},source=create(null),sourceConstructor={value:Symbol},sourceMap=function(uid){return source[uid]},$defineProperty=function defineProp(o,key,descriptor){var uid=""+key;if(onlySymbols(uid)){setDescriptor(o,uid,descriptor.enumerable?copyAsNonEnumerable(descriptor):descriptor);addInternalIfNeeded(o,uid,!!descriptor.enumerable)}else{defineProperty(o,key,descriptor)}return o},$getOwnPropertySymbols=function getOwnPropertySymbols(o){return gOPN(o).filter(onlySymbols).map(sourceMap)};descriptor.value=$defineProperty;defineProperty(Object,DP,descriptor);descriptor.value=$getOwnPropertySymbols;defineProperty(Object,GOPS,descriptor);descriptor.value=function getOwnPropertyNames(o){return gOPN(o).filter(onlyNonSymbols)};defineProperty(Object,GOPN,descriptor);descriptor.value=function defineProperties(o,descriptors){var symbols=$getOwnPropertySymbols(descriptors);if(symbols.length){keys(descriptors).concat(symbols).forEach(function(uid){if(propertyIsEnumerable.call(descriptors,uid)){$defineProperty(o,uid,descriptors[uid])}})}else{$defineProperties(o,descriptors)}return o};defineProperty(Object,DPies,descriptor);descriptor.value=propertyIsEnumerable;defineProperty(ObjectProto,PIE,descriptor);descriptor.value=Symbol;defineProperty(G,"Symbol",descriptor);descriptor.value=function(key){var uid=prefix.concat(prefix,key,random);return uid in ObjectProto?source[uid]:setAndGetSymbol(uid)};defineProperty(Symbol,"for",descriptor);descriptor.value=function(symbol){if(onlyNonSymbols(symbol))throw new TypeError(symbol+" is not a symbol");if(!hOP.call(source,symbol)){return void 0}var label=symbol.slice(prefixLength);if(label.slice(0,prefixLength)!==prefix){return void 0}label=label.slice(prefixLength);if(label===random){return void 0}label=label.slice(0,label.length-random.length);return label.length>0?label:void 0};defineProperty(Symbol,"keyFor",descriptor);descriptor.value=function getOwnPropertyDescriptor(o,key){var descriptor=gOPD(o,key);if(descriptor&&onlySymbols(key)){descriptor.enumerable=propertyIsEnumerable.call(o,key)}return descriptor};defineProperty(Object,GOPD,descriptor);descriptor.value=function(proto,descriptors){return arguments.length===1||typeof descriptors==="undefined"?create(proto):createWithSymbols(proto,descriptors)};defineProperty(Object,"create",descriptor);descriptor.value=function(){var str=toString.call(this);return str==="[object String]"&&onlySymbols(this)?"[object Symbol]":str};defineProperty(ObjectProto,"toString",descriptor);try{if(true===create(defineProperty({},prefix,{get:function(){return defineProperty(this,prefix,{value:true})[prefix]}}))[prefix]){setDescriptor=defineProperty}else{throw"IE11"}}catch(o_O){setDescriptor=function(o,key,descriptor){var protoDescriptor=gOPD(ObjectProto,key);delete ObjectProto[key];defineProperty(o,key,descriptor);defineProperty(ObjectProto,key,protoDescriptor)}}})(Object,"getOwnPropertySymbols");(function(O,Symbol){"use strict";var dP=O.defineProperty,ObjectProto=O.prototype,toString=ObjectProto.toString,toStringTag="toStringTag",descriptor;["iterator","match","replace","search","split","hasInstance","isConcatSpreadable","unscopables","species","toPrimitive",toStringTag].forEach(function(name){if(!(name in Symbol)){dP(Symbol,name,{value:Symbol(name)});switch(name){case toStringTag:descriptor=O.getOwnPropertyDescriptor(ObjectProto,"toString");descriptor.value=function(){var str=toString.call(this),tst=this!=null?this[Symbol.toStringTag]:this;return tst==null?str:"[object "+tst+"]"};dP(ObjectProto,"toString",descriptor);break}}})})(Object,Symbol);(function(Si,AP,SP){function returnThis(){return this}if(!AP[Si])AP[Si]=function(){var i=0,self=this,iterator={next:function next(){var done=self.length<=i;return done?{done:done}:{done:done,value:self[i++]}}};iterator[Si]=returnThis;return iterator};if(!SP[Si])SP[Si]=function(){var fromCodePoint=String.fromCodePoint,self=this,i=0,length=self.length,iterator={next:function next(){var done=length<=i,c=done?"":fromCodePoint(self.codePointAt(i));i+=c.length;return done?{done:done}:{done:done,value:c}}};iterator[Si]=returnThis;return iterator}})(Symbol.iterator,Array.prototype,String.prototype); |
@@ -54,6 +54,2 @@ /*! | ||
toString = ObjectProto.toString, | ||
indexOf = Array.prototype.indexOf || function (v) { | ||
for (var i = this.length; i-- && this[i] !== v;) {} | ||
return i; | ||
}, | ||
addInternalIfNeeded = function (o, uid, enumerable) { | ||
@@ -194,6 +190,15 @@ if (!hOP.call(o, internalSymbol)) { | ||
throw new TypeError(symbol + ' is not a symbol'); | ||
return hOP.call(source, symbol) ? | ||
symbol.slice(prefixLength * 2, -random.length) : | ||
void 0 | ||
; | ||
if (!hOP.call(source, symbol)) { | ||
return void 0; | ||
} | ||
var label = symbol.slice(prefixLength); | ||
if (label.slice(0, prefixLength) !== prefix) { | ||
return void 0; | ||
} | ||
label = label.slice(prefixLength); | ||
if (label === random) { | ||
return void 0; | ||
} | ||
label = label.slice(0, label.length - random.length); | ||
return label.length > 0 ? label : void 0; | ||
}; | ||
@@ -212,3 +217,3 @@ defineProperty(Symbol, 'keyFor', descriptor); | ||
descriptor.value = function (proto, descriptors) { | ||
return arguments.length === 1 ? | ||
return (arguments.length === 1 || typeof descriptors === "undefined") ? | ||
create(proto) : | ||
@@ -226,3 +231,3 @@ createWithSymbols(proto, descriptors); | ||
try { // fails in few pre ES 5.1 engines | ||
setDescriptor = create( | ||
if (true === create( | ||
defineProperty( | ||
@@ -233,7 +238,11 @@ {}, | ||
get: function () { | ||
return defineProperty(this, prefix, {value: false})[prefix]; | ||
return defineProperty(this, prefix, {value: true})[prefix]; | ||
} | ||
} | ||
) | ||
)[prefix] || defineProperty; | ||
)[prefix]) { | ||
setDescriptor = defineProperty; | ||
} else { | ||
throw 'IE11'; | ||
} | ||
} catch(o_O) { | ||
@@ -250,3 +259,3 @@ setDescriptor = function (o, key, descriptor) { | ||
(function (O, S) { | ||
(function (O, Symbol) {'use strict'; | ||
var | ||
@@ -280,5 +289,5 @@ dP = O.defineProperty, | ||
str = toString.call(this), | ||
tst = this[Symbol.toStringTag] | ||
tst = this != null ? this[Symbol.toStringTag] : this | ||
; | ||
return typeof tst === 'undefined' ? str : ('[object ' + tst + ']'); | ||
return tst == null ? str : ('[object ' + tst + ']'); | ||
}; | ||
@@ -285,0 +294,0 @@ dP(ObjectProto, 'toString', descriptor); |
@@ -54,6 +54,2 @@ /*! | ||
toString = ObjectProto.toString, | ||
indexOf = Array.prototype.indexOf || function (v) { | ||
for (var i = this.length; i-- && this[i] !== v;) {} | ||
return i; | ||
}, | ||
addInternalIfNeeded = function (o, uid, enumerable) { | ||
@@ -194,6 +190,15 @@ if (!hOP.call(o, internalSymbol)) { | ||
throw new TypeError(symbol + ' is not a symbol'); | ||
return hOP.call(source, symbol) ? | ||
symbol.slice(prefixLength * 2, -random.length) : | ||
void 0 | ||
; | ||
if (!hOP.call(source, symbol)) { | ||
return void 0; | ||
} | ||
var label = symbol.slice(prefixLength); | ||
if (label.slice(0, prefixLength) !== prefix) { | ||
return void 0; | ||
} | ||
label = label.slice(prefixLength); | ||
if (label === random) { | ||
return void 0; | ||
} | ||
label = label.slice(0, label.length - random.length); | ||
return label.length > 0 ? label : void 0; | ||
}; | ||
@@ -212,3 +217,3 @@ defineProperty(Symbol, 'keyFor', descriptor); | ||
descriptor.value = function (proto, descriptors) { | ||
return arguments.length === 1 ? | ||
return (arguments.length === 1 || typeof descriptors === "undefined") ? | ||
create(proto) : | ||
@@ -226,3 +231,3 @@ createWithSymbols(proto, descriptors); | ||
try { // fails in few pre ES 5.1 engines | ||
setDescriptor = create( | ||
if (true === create( | ||
defineProperty( | ||
@@ -233,7 +238,11 @@ {}, | ||
get: function () { | ||
return defineProperty(this, prefix, {value: false})[prefix]; | ||
return defineProperty(this, prefix, {value: true})[prefix]; | ||
} | ||
} | ||
) | ||
)[prefix] || defineProperty; | ||
)[prefix]) { | ||
setDescriptor = defineProperty; | ||
} else { | ||
throw 'IE11'; | ||
} | ||
} catch(o_O) { | ||
@@ -250,3 +259,3 @@ setDescriptor = function (o, key, descriptor) { | ||
(function (O, S) { | ||
(function (O, Symbol) {'use strict'; | ||
var | ||
@@ -280,5 +289,5 @@ dP = O.defineProperty, | ||
str = toString.call(this), | ||
tst = this[Symbol.toStringTag] | ||
tst = this != null ? this[Symbol.toStringTag] : this | ||
; | ||
return typeof tst === 'undefined' ? str : ('[object ' + tst + ']'); | ||
return tst == null ? str : ('[object ' + tst + ']'); | ||
}; | ||
@@ -285,0 +294,0 @@ dP(ObjectProto, 'toString', descriptor); |
{ | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"license": "MIT", | ||
@@ -25,3 +25,5 @@ "name": "get-own-property-symbols", | ||
"build": "make", | ||
"test": "node test/.test.js" | ||
"prepublish": "npm run build", | ||
"test": "npm run tests-only", | ||
"tests-only": "node test/.test.js" | ||
}, | ||
@@ -32,5 +34,5 @@ "devDependencies": { | ||
"tiny-cdn": "^0.5.2", | ||
"uglify-js": "^1.3.5", | ||
"uglify-js": "^2.7.3", | ||
"wru": "^0.2.7" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
61445
22
1352
1
2