MCPcopy
hub / github.com/javascript-obfuscator/javascript-obfuscator / fastKey

Function fastKey

test/fixtures/compile-performance.js:8107–8119  ·  view source on GitHub ↗
(it, create)

Source from the content-addressed store, hash-verified

8105 }});
8106 };
8107 var fastKey = function(it, create){
8108 // return primitive with prefix
8109 if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
8110 if(!has(it, META)){
8111 // can't set metadata to uncaught frozen object
8112 if(!isExtensible(it))return 'F';
8113 // not necessary to add metadata
8114 if(!create)return 'E';
8115 // add missing metadata
8116 setMeta(it);
8117 // return object ID
8118 } return it[META].i;
8119 };
8120 var getWeak = function(it, create){
8121 if(!has(it, META)){
8122 // can't set metadata to uncaught frozen object

Callers 2

getEntryFunction · 0.85

Calls 3

isObjectFunction · 0.85
setMetaFunction · 0.85
hasFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…