Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

weakmap

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weakmap - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

weakmap.min.js

2

package.json

@@ -6,3 +6,3 @@ {

"keywords": ["harmony", "collection", "weakmap","ecmascript", "es6", "shim", "garbage collection", "gc"],
"version": "0.0.2",
"version": "0.0.3",
"homepage": "http://benvie.github.com/WeakMap",

@@ -9,0 +9,0 @@ "repository": {

@@ -58,21 +58,22 @@ /* (The MIT License)

uids = create(null),
globalID = createUID();
function createUID(){
var key = Math.random().toString(36).slice(2);
return key in uids ? createUID() : uids[key] = key;
}
createUID = function(){
var key = Math.random().toString(36).slice(2);
return key in uids ? createUID() : uids[key] = key;
},
function storage(obj){
if (hasOwn.call(obj, globalID))
return obj[globalID];
globalID = createUID(),
if (!Object.isExtensible(obj))
throw new TypeError("Object must be extensible");
storage = function(obj){
if (hasOwn.call(obj, globalID))
return obj[globalID];
var store = create(null);
defProp(obj, globalID, { value: store });
return store;
}
if (!Object.isExtensible(obj))
throw new TypeError("Object must be extensible");
var store = create(null);
defProp(obj, globalID, { value: store });
return store;
};
// common per-object storage area made visible by patching getOwnPropertyNames'

@@ -141,3 +142,3 @@ define(Object, function getOwnPropertyNames(obj){

function WeakMap(iterable){
if (this === global || this == null || this === prototype)
if (this === global || this == null || this === WeakMap.prototype)
return new WeakMap(iterable);

@@ -180,4 +181,4 @@

try {
var src = ('return '+delete_).replace('e_', '\\u0065');
var del = new Function('unwrap', 'validate', src)(unwrap, validate);
var src = ('return '+delete_).replace('e_', '\\u0065'),
del = new Function('unwrap', 'validate', src)(unwrap, validate);
} catch (e) {

@@ -188,7 +189,15 @@ var del = delete_;

var src = (''+Object).split('Object');
var stringifier = function toString(){
return src[0] + nameOf(this) + src[1];
};
define(stringifier, stringifier);
var prep = { __proto__: [] } instanceof Array
? function(f){ f.__proto__ = stringifier }
: function(f){ define(f, stringifier) };
[toString, get, set, has, del].forEach(function(method){
define(WeakMap.prototype, method);
define(method, function toString(){
return src[0] + nameOf(this) + src[1];
});
prep(method);
});

@@ -195,0 +204,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc