MCPcopy Index your code
hub / github.com/nodejs/node / detachFromUserPrototypes

Function detachFromUserPrototypes

lib/internal/crypto/webcrypto.js:783–799  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

781// Detach internal JSON values from the current global's mutable prototypes to
782// approximate those fresh-realm semantics without creating a new realm.
783function detachFromUserPrototypes(value) {
784 if (value === null || typeof value !== 'object')
785 return;
786
787 ObjectSetPrototypeOf(value, null);
788
789 if (ArrayIsArray(value)) {
790 setOwnProperty(value, SymbolIterator, safeArrayIterator);
791 for (let n = 0; n < value.length; n++)
792 detachFromUserPrototypes(value[n]);
793 return;
794 }
795
796 const keys = ObjectKeys(value);
797 for (let n = 0; n < keys.length; n++)
798 detachFromUserPrototypes(value[keys[n]]);
799}
800
801// Parse wrapped JWK bytes according to WebCrypto's "parse a JWK" procedure.
802function parseJwk(data) {

Callers 2

parseJwkFunction · 0.85
wrapKeyImplFunction · 0.85

Calls 1

setOwnPropertyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…