@locker/shared-dom
Advanced tools
Comparing version 0.15.10 to 0.15.11
@@ -109,6 +109,7 @@ /*! | ||
closest: ElementProtoClosest$LWS, | ||
getAttribute: ElementProtoGetAttribute$LWS, | ||
getAttributeNode: ElementProtoGetAttributeNode$LWS, | ||
getAttributeNodeNS: ElementProtoGetAttributeNodeNS$LWS, | ||
hasAttribute: ElementProtoHasAttribute$LWS, | ||
querySelector: ElementProtoQuerySelector$LWS, | ||
remove: ElementProtoRemove$LWS, | ||
removeAttributeNode: ElementProtoRemoveAttributeNode$LWS | ||
@@ -145,2 +146,6 @@ } = Element.prototype; | ||
function ElementGetAttribute$LWS(el$LWS, attrName$LWS) { | ||
return shared$LWS.ReflectApply(ElementProtoGetAttribute$LWS, el$LWS, [attrName$LWS]); | ||
} | ||
function ElementGetAttributeNode$LWS(el$LWS, attrName$LWS) { | ||
@@ -154,2 +159,6 @@ return shared$LWS.ReflectApply(ElementProtoGetAttributeNode$LWS, el$LWS, [attrName$LWS]); | ||
function ElementHasAttribute$LWS(el$LWS, attrName$LWS) { | ||
return shared$LWS.ReflectApply(ElementProtoHasAttribute$LWS, el$LWS, [attrName$LWS]); | ||
} | ||
function ElementSetAttribute$LWS(el$LWS, name$LWS, value$LWS) { | ||
@@ -163,6 +172,2 @@ return shared$LWS.ReflectApply(ElementProtoSetAttribute$LWS, el$LWS, [name$LWS, value$LWS]); | ||
function ElementRemove$LWS(el$LWS) { | ||
return shared$LWS.ReflectApply(ElementProtoRemove$LWS, el$LWS, []); | ||
} | ||
function ElementRemoveAttributeNode$LWS(el$LWS, attrNode$LWS) { | ||
@@ -183,11 +188,13 @@ return shared$LWS.ReflectApply(ElementProtoRemoveAttributeNode$LWS, el$LWS, [attrNode$LWS]); | ||
const { | ||
prototype: NodeProto$LWS | ||
} = Node; | ||
const { | ||
appendChild: NodeProtoAppendChild$LWS, | ||
cloneNode: NodeProtoCloneNode$LWS, | ||
isEqualNode: NodeProtoIsEqualNode$LWS | ||
} = Node.prototype; | ||
const NodeProtoChildNodesGetter$LWS = shared$LWS.ObjectLookupOwnGetter(Node.prototype, 'childNodes'); | ||
const NodeProtoFirstChildGetter$LWS = shared$LWS.ObjectLookupOwnGetter(Node.prototype, 'firstChild'); | ||
const NodeProtoLastChildGetter$LWS = shared$LWS.ObjectLookupOwnGetter(Node.prototype, 'lastChild'); | ||
const NodeProtoNodeNameGetter$LWS = shared$LWS.ObjectLookupOwnGetter(Node.prototype, 'nodeName'); | ||
const NodeProtoOwnerDocumentGetter$LWS = shared$LWS.ObjectLookupOwnGetter(Node.prototype, 'ownerDocument'); | ||
} = NodeProto$LWS; | ||
const NodeProtoChildNodesGetter$LWS = shared$LWS.ObjectLookupOwnGetter(NodeProto$LWS, 'childNodes'); | ||
const NodeProtoFirstChildGetter$LWS = shared$LWS.ObjectLookupOwnGetter(NodeProto$LWS, 'firstChild'); | ||
const NodeProtoNodeNameGetter$LWS = shared$LWS.ObjectLookupOwnGetter(NodeProto$LWS, 'nodeName'); | ||
const NodeProtoOwnerDocumentGetter$LWS = shared$LWS.ObjectLookupOwnGetter(NodeProto$LWS, 'ownerDocument'); | ||
@@ -214,6 +221,2 @@ function NodeAppendChild$LWS(node$LWS, childNode$LWS) { | ||
function NodeLastChildGetter$LWS(node$LWS) { | ||
return shared$LWS.ReflectApply(NodeProtoLastChildGetter$LWS, node$LWS, []); | ||
} | ||
function NodeNameGetter$LWS(node$LWS) { | ||
@@ -302,6 +305,2 @@ // Normalize nodeName to upper case. | ||
function JSONClone$LWS(value$LWS) { | ||
return shared$LWS.JSONParse(shared$LWS.JSONStringify(value$LWS)); | ||
} | ||
function transformUncompiledSource$LWS(source$LWS) { | ||
@@ -330,4 +329,4 @@ // Input `source` is uncompiled, so window.location returns null inside the sandbox. Our | ||
if (locationTransformed$LWS) { | ||
// Prepend the SANDBOX_EVAL_CONTEXT_NAME to pluck the UNCOMPILED_LOCATION_NAME only if the | ||
// source code actually uses (document|self|window).location | ||
// Prepend the SANDBOX_EVAL_CONTEXT_NAME to pluck the UNCOMPILED_LOCATION_NAME | ||
// only if the source code actually uses (document|self|window).location | ||
source$LWS = `const { ${shared$LWS.UNCOMPILED_LOCATION_NAME} } = ${shared$LWS.SANDBOX_EVAL_CONTEXT_NAME};${source$LWS}`; | ||
@@ -358,2 +357,304 @@ } | ||
const SEEN_OBJECTS_MAP$LWS = new shared$LWS.MapCtor(); | ||
function cloneBoxedPrimitive$LWS(object$LWS) { | ||
return shared$LWS.ObjectCtor(shared$LWS.getNearMembraneSerializedValue(object$LWS)); | ||
} | ||
function cloneMap$LWS(map$LWS, queue$LWS) { | ||
// Section 2.7.3 StructuredSerializeInternal: | ||
// https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal | ||
// Step 26.1.1: Let copiedList be a new empty List. | ||
const clone$LWS = new shared$LWS.MapCtor(); // Step 26.1.2: For each Record { [[Key]], [[Value]] } entry of value.[[MapData]]... | ||
const entriesIterable$LWS = shared$LWS.MapEntries(map$LWS); // Step 26.1.3 For each Record { [[Key]], [[Value]] } entry of copiedList: | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
const { | ||
done: done$LWS, | ||
value: subKeyValuePair$LWS | ||
} = entriesIterable$LWS.next(); | ||
if (done$LWS) { | ||
break; | ||
} | ||
const { | ||
0: subKey$LWS, | ||
1: subValue$LWS | ||
} = subKeyValuePair$LWS; | ||
let subCloneKey$LWS; | ||
shared$LWS.ArrayPush(queue$LWS, // Step 26.1.3.1: Let serializedKey be ? StructuredSerializeInternal(entry.[[Key]], forStorage, memory). | ||
[subClone$LWS => { | ||
subCloneKey$LWS = subClone$LWS; | ||
}, subKey$LWS], // Step 26.1.3.2: Let serializedValue be ? StructuredSerializeInternal(entry.[[Value]], forStorage, memory). | ||
[subCloneValue$LWS => { | ||
shared$LWS.MapSet(clone$LWS, subCloneKey$LWS, subCloneValue$LWS); | ||
}, subValue$LWS]); | ||
} | ||
return clone$LWS; | ||
} | ||
function cloneRegExp$LWS(regexp$LWS) { | ||
const { | ||
flags: flags$LWS, | ||
source: source$LWS | ||
} = shared$LWS.JSONParse(shared$LWS.getNearMembraneSerializedValue(regexp$LWS)); | ||
return new shared$LWS.RegExpCtor(source$LWS, flags$LWS); | ||
} | ||
function cloneSet$LWS(set$LWS, queue$LWS) { | ||
// Section 2.7.3 StructuredSerializeInternal: | ||
// https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal | ||
// Step 26.2.1: Let copiedList be a new empty List. | ||
const clone$LWS = new shared$LWS.SetCtor(); // Step 26.2.2: For each entry of value.[[SetData]]... | ||
const valuesIterable$LWS = shared$LWS.SetValues(set$LWS); // Step 26.2.3: For each entry of copiedList: | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
const { | ||
done: done$LWS, | ||
value: subValue$LWS | ||
} = valuesIterable$LWS.next(); | ||
if (done$LWS) { | ||
break; | ||
} | ||
shared$LWS.ArrayPush(queue$LWS, // Step 26.2.3.1: Let serializedEntry be ? StructuredSerializeInternal(entry, forStorage, memory). | ||
[subCloneValue$LWS => { | ||
shared$LWS.SetAdd(clone$LWS, subCloneValue$LWS); | ||
}, subValue$LWS]); | ||
} | ||
return clone$LWS; | ||
} | ||
function enqueue$LWS(queue$LWS, originalValue$LWS, cloneValue$LWS) { | ||
// Section 2.7.3 StructuredSerializeInternal: | ||
// https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal | ||
// Step 26.4: Otherwise, for each key in ! EnumerableOwnPropertyNames(value, key)... | ||
// Note: Object.keys() performs EnumerableOwnPropertyNames() internally as | ||
// defined in ECMA262: | ||
// https://tc39.es/ecma262/#sec-object.keys | ||
const keys$LWS = shared$LWS.ObjectKeys(originalValue$LWS); | ||
for (let i$LWS = 0, { | ||
length: length$LWS | ||
} = keys$LWS; i$LWS < length$LWS; i$LWS += 1) { | ||
// Step 26.4.1.1: Let inputValue be ? value.[[Get]](key, value). | ||
// The [[Get]] operation is defined in ECMA262 for ordinary objects, | ||
// argument objects, integer-indexed exotic objects, module namespace | ||
// objects, and proxy objects. | ||
// https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver | ||
const key$LWS = keys$LWS[i$LWS]; | ||
const subValue$LWS = originalValue$LWS[key$LWS]; | ||
shared$LWS.ArrayPush(queue$LWS, [subCloneValue$LWS => { | ||
// Step 26.4.1.3: Property descriptor attributes are not | ||
// preserved during deserialization because only keys and | ||
// values are captured in serialized.[[Properties]]. | ||
cloneValue$LWS[key$LWS] = subCloneValue$LWS; | ||
}, subValue$LWS]); | ||
} | ||
} // This function is the unguarded internal variant of `partialStructuredClone()`. | ||
// Any error thrown that is captured by `partialStructuredClone()` is treated as | ||
// a `DataCloneError`. This function clones blue membrane proxied arrays, plain | ||
// objects, maps, regexps, sets, and boxed primitives. The following non-membrane | ||
// proxied objects are set by reference instead of cloning: | ||
// ArrayBuffer | ||
// BigInt64Array | ||
// BigUint64Array | ||
// Blob | ||
// DataView | ||
// Date | ||
// DOMException | ||
// DOMMatrix | ||
// DOMMatrixReadOnly | ||
// DOMPoint | ||
// DOMPointReadOnly | ||
// DOMQuad | ||
// DOMRect | ||
// DOMRectReadOnly | ||
// Error | ||
// EvalError | ||
// File | ||
// FileList | ||
// Float32Array | ||
// Float64Array | ||
// ImageBitMap | ||
// ImageData | ||
// Int8Array | ||
// Int16Array | ||
// Int32Array | ||
// RangeError | ||
// ReferenceError | ||
// SyntaxError | ||
// TypeError | ||
// Uint8Array | ||
// Uint8ClampedArray | ||
// Uint16Array | ||
// Uint32Array | ||
// URIError | ||
// | ||
// Note: | ||
// This function performs brand checks using `Object.prototype.toString`. The | ||
// results can be faked with `Symbol.toStringTag` property values and are a poor | ||
// substitute for native internal slot checks. However, for our purposes they | ||
// are perfectly fine and avoid having to repeatedly walk the prototype of proxied | ||
// values. Cloned values should be passed to native methods, like `postMessage()`, | ||
// which perform their own validation with internal slot checks. | ||
function partialStructuredCloneInternal$LWS(value$LWS) { | ||
// Using a queue instead of recursive function calls avoids call stack limits | ||
// and enables cloning more complex and deeply nested objects. | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Too_much_recursion | ||
let result$LWS; | ||
const queue$LWS = [[subClone$LWS => { | ||
result$LWS = subClone$LWS; | ||
}, value$LWS]]; // eslint-disable-next-line no-labels | ||
queueLoop: while (queue$LWS.length) { | ||
// Section 2.7.3 StructuredSerializeInternal: | ||
// https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal | ||
// prettier-ignore | ||
const { | ||
0: setter$LWS, | ||
1: originalValue$LWS | ||
} = shared$LWS.ArrayShift(queue$LWS); // Step 4: If Type(value) is Undefined, Null, Boolean, Number, BigInt, or String | ||
if (originalValue$LWS === null || originalValue$LWS === undefined || typeof originalValue$LWS === 'boolean' || typeof originalValue$LWS === 'number' || typeof originalValue$LWS === 'string' || typeof originalValue$LWS === 'bigint') { | ||
setter$LWS(originalValue$LWS); // eslint-disable-next-line no-continue, no-extra-label, no-labels | ||
continue queueLoop; | ||
} // Step 5: If Type(value) is Symbol, then throw a 'DataCloneError' DOMException. | ||
if (typeof originalValue$LWS === 'symbol') { | ||
// Stop cloning and set the original value and defer throwing to | ||
// native methods. | ||
setter$LWS(originalValue$LWS); // eslint-disable-next-line no-extra-label, no-labels | ||
break queueLoop; | ||
} // To support circular references check if the original value has been | ||
// seen. If it has then use the clone associated with its record instead | ||
// of creating a new clone. | ||
let cloneValue$LWS = shared$LWS.MapGet(SEEN_OBJECTS_MAP$LWS, originalValue$LWS); | ||
if (cloneValue$LWS) { | ||
setter$LWS(cloneValue$LWS); // eslint-disable-next-line no-continue, no-extra-label, no-labels | ||
continue queueLoop; | ||
} // Perform a brand check on originalValue. | ||
const brand$LWS = shared$LWS.getBrand(originalValue$LWS); // eslint-disable-next-line default-case | ||
switch (brand$LWS) { | ||
// Step 19: Otherwise, if value is a platform object... | ||
case shared$LWS.TO_STRING_BRAND_OBJECT: | ||
{ | ||
const proto$LWS = shared$LWS.ReflectGetPrototypeOf(originalValue$LWS); | ||
if (proto$LWS === shared$LWS.ObjectProto || proto$LWS === null) { | ||
cloneValue$LWS = {}; // Step 19.4: Set deep to true. | ||
enqueue$LWS(queue$LWS, originalValue$LWS, cloneValue$LWS); | ||
} | ||
break; | ||
} | ||
// Step 18: Otherwise, if value is an Array exotic object... | ||
case shared$LWS.TO_STRING_BRAND_ARRAY: | ||
// Step 18.1 Let valueLenDescriptor be ? OrdinaryGetOwnProperty(value, 'length'). | ||
// Note: Rather than perform the more complex OrdinaryGetOwnProperty() | ||
// operation for 'length' because it is a non-configurable property | ||
// we can access it with the simpler [[Get]]() operation defined | ||
// in ECMA262. | ||
// https://tc39.es/ecma262/#sec-integer-indexed-exotic-objects-get-p-receiver | ||
cloneValue$LWS = new shared$LWS.ArrayCtor(originalValue$LWS.length); // Step 18.4: Set deep to true. | ||
enqueue$LWS(queue$LWS, originalValue$LWS, cloneValue$LWS); | ||
break; | ||
// Step 15: Otherwise, if value has [[MapData]] internal slot... | ||
// Step 15.2: Set deep to true. | ||
case shared$LWS.TO_STRING_BRAND_MAP: | ||
cloneValue$LWS = cloneMap$LWS(originalValue$LWS, queue$LWS); | ||
break; | ||
// Step 16: Otherwise, if value has [[SetData]] internal slot... | ||
// Step 16.2: Set deep to true. | ||
case shared$LWS.TO_STRING_BRAND_SET: | ||
cloneValue$LWS = cloneSet$LWS(originalValue$LWS, queue$LWS); | ||
break; | ||
} | ||
if (cloneValue$LWS === undefined) { | ||
if (!shared$LWS.isNearMembrane(originalValue$LWS)) { | ||
// Skip cloning non-membrane proxied objects. | ||
shared$LWS.MapSet(SEEN_OBJECTS_MAP$LWS, originalValue$LWS, originalValue$LWS); | ||
setter$LWS(originalValue$LWS); // eslint-disable-next-line no-extra-label, no-labels | ||
continue queueLoop; | ||
} // Cases ordered by a guestimate on frequency of encounter. | ||
// eslint-disable-next-line default-case | ||
switch (brand$LWS) { | ||
// Step 12: Otherwise, if value has a [[RegExpMatcher]] internal slot... | ||
case shared$LWS.TO_STRING_BRAND_REG_EXP: | ||
cloneValue$LWS = cloneRegExp$LWS(originalValue$LWS); | ||
break; | ||
// Step 7: If value has a [[BooleanData]] internal slot... | ||
case shared$LWS.TO_STRING_BRAND_BOOLEAN: // Step 8: Otherwise, if value has a [[NumberData]] internal slot... | ||
// eslint-disable-next-line no-fallthrough | ||
case shared$LWS.TO_STRING_BRAND_NUMBER: // Step 9: Otherwise, if value has a [[BigIntData]] internal slot... | ||
// eslint-disable-next-line no-fallthrough | ||
case shared$LWS.TO_STRING_BRAND_BIG_INT: // Step 10: Otherwise, if value has a [[StringData]] internal slot... | ||
// eslint-disable-next-line no-fallthrough | ||
case shared$LWS.TO_STRING_BRAND_STRING: | ||
cloneValue$LWS = cloneBoxedPrimitive$LWS(originalValue$LWS); | ||
break; | ||
} | ||
} // Step 21: Otherwise, if IsCallable(value) is true, then throw a 'DataCloneError' | ||
// Step 20: Otherwise, if value is a platform object, then throw a 'DataCloneError' | ||
if (cloneValue$LWS === undefined) { | ||
// Stop cloning and set the original value and defer throwing to | ||
// native methods. | ||
setter$LWS(originalValue$LWS); // eslint-disable-next-line no-extra-label, no-labels | ||
break queueLoop; | ||
} | ||
shared$LWS.MapSet(SEEN_OBJECTS_MAP$LWS, originalValue$LWS, cloneValue$LWS); | ||
setter$LWS(cloneValue$LWS); | ||
} | ||
return result$LWS; | ||
} | ||
function partialStructuredClone$LWS(value$LWS) { | ||
let result$LWS = value$LWS; | ||
try { | ||
result$LWS = partialStructuredCloneInternal$LWS(value$LWS); // eslint-disable-next-line no-empty | ||
} catch (_unused$LWS) {} | ||
shared$LWS.MapClear(SEEN_OBJECTS_MAP$LWS); | ||
return result$LWS; | ||
} | ||
const { | ||
@@ -429,3 +730,2 @@ getElementById: DocumentFragmentProtoGetElementById$LWS, | ||
const HTMLElementProtoDatasetGetter$LWS = shared$LWS.ObjectLookupOwnGetter(HTMLElement.prototype, 'dataset'); | ||
const HTMLElementProtoStyleGetter$LWS = shared$LWS.ObjectLookupOwnGetter(HTMLElement.prototype, 'style'); | ||
@@ -436,7 +736,2 @@ function HTMLElementDatasetGetter$LWS(el$LWS) { | ||
function HTMLElementStyleGetter$LWS(el$LWS) { | ||
return shared$LWS.ReflectApply(HTMLElementProtoStyleGetter$LWS, el$LWS, []); | ||
} | ||
const HTMLIFrameElementProtoContentWindowGetter$LWS = shared$LWS.ObjectLookupOwnGetter(HTMLIFrameElement.prototype, 'contentWindow'); | ||
const HTMLIFrameElementProtoSrcSetter$LWS = shared$LWS.ObjectLookupOwnSetter(HTMLIFrameElement.prototype, 'src'); | ||
@@ -448,6 +743,2 @@ | ||
function HTMLIFrameElementContentWindowGetter$LWS(iframe$LWS) { | ||
return shared$LWS.ReflectApply(HTMLIFrameElementProtoContentWindowGetter$LWS, iframe$LWS, []); | ||
} | ||
const { | ||
@@ -490,3 +781,5 @@ get: HTMLScriptElementProtoSrcGetter$LWS, | ||
const ALLOW_LIST_RAW$LWS = ['close', 'closed', 'focus']; | ||
const DEFAULT_OVERWRITTEN_VALUE$LWS = {}; // These properties are part of the WindowOrGlobalScope mixin and not on Window.prototype. | ||
const DEFAULT_OVERWRITTEN_VALUE$LWS = {}; | ||
const rawToPatchedWindowMap$LWS = new shared$LWS.WeakMapCtor(); // These properties are part of the WindowOrGlobalScope mixin and not on | ||
// Window.prototype. | ||
// https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope | ||
@@ -500,38 +793,8 @@ | ||
const WindowStaticSelfGetter$LWS = shared$LWS.ObjectLookupOwnGetter(window, 'self'); | ||
const { | ||
decodeURIComponent: WindowDecodeURIComponent$LWS, | ||
encodeURIComponent: WindowEncodeURIComponent$LWS | ||
} = window; // istanbul ignore next | ||
function WindowClearInterval$LWS(win$LWS, intervalID$LWS) { | ||
return shared$LWS.ReflectApply(WindowStaticClearInterval$LWS, win$LWS, [intervalID$LWS]); | ||
} | ||
function WindowLengthGetter$LWS(win$LWS) { | ||
return shared$LWS.ReflectApply(WindowStaticLengthGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSelfGetter$LWS(win$LWS) { | ||
return shared$LWS.ReflectApply(WindowStaticSelfGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSetInterval$LWS(win$LWS, ...args$LWS) { | ||
return shared$LWS.ReflectApply(WindowStaticSetInterval$LWS, win$LWS, args$LWS); | ||
} | ||
const patchedWindowMap$LWS = new shared$LWS.WeakMapCtor(); // istanbul ignore next | ||
function getPatchedWindow$LWS(win$LWS) { | ||
let patchedContentWindow$LWS = null; | ||
if (win$LWS !== null) { | ||
patchedContentWindow$LWS = shared$LWS.WeakMapGet(patchedWindowMap$LWS, win$LWS); | ||
if (!patchedContentWindow$LWS) { | ||
patchedContentWindow$LWS = createPatchedWindow$LWS(win$LWS); | ||
shared$LWS.WeakMapSet(patchedWindowMap$LWS, win$LWS, patchedContentWindow$LWS); | ||
} | ||
} | ||
return patchedContentWindow$LWS; | ||
} // istanbul ignore next | ||
function createPatchedWindow$LWS(rawWindow$LWS) { | ||
function createPatchedWindow$LWS(win$LWS) { | ||
const patchedWindow$LWS = {}; | ||
@@ -543,3 +806,3 @@ | ||
const key$LWS = ALLOW_LIST_RAW$LWS[i$LWS]; | ||
const unsafeDesc$LWS = shared$LWS.ReflectGetOwnPropertyDescriptor(rawWindow$LWS, key$LWS); | ||
const unsafeDesc$LWS = shared$LWS.ReflectGetOwnPropertyDescriptor(win$LWS, key$LWS); | ||
@@ -553,3 +816,3 @@ if (unsafeDesc$LWS) { | ||
if (typeof originalValue$LWS === 'function') { | ||
const bound$LWS = shared$LWS.FunctionBind(originalValue$LWS, rawWindow$LWS); | ||
const bound$LWS = shared$LWS.FunctionBind(originalValue$LWS, win$LWS); | ||
const unsafeNameDesc$LWS = shared$LWS.ReflectGetOwnPropertyDescriptor(originalValue$LWS, 'name'); | ||
@@ -571,3 +834,3 @@ | ||
safeDesc$LWS.get = function get$LWS() { | ||
return overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS ? shared$LWS.ReflectApply(getter$LWS, rawWindow$LWS, []) : overwrittenValue$LWS; | ||
return overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS ? shared$LWS.ReflectApply(getter$LWS, win$LWS, []) : overwrittenValue$LWS; | ||
}; | ||
@@ -591,3 +854,3 @@ } | ||
const key$LWS = ALLOW_LIST_PATCHED$LWS[i$LWS]; | ||
const unsafeDesc$LWS = shared$LWS.ReflectGetOwnPropertyDescriptor(rawWindow$LWS, key$LWS); | ||
const unsafeDesc$LWS = shared$LWS.ReflectGetOwnPropertyDescriptor(win$LWS, key$LWS); | ||
@@ -605,3 +868,3 @@ if (unsafeDesc$LWS) { | ||
if (overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS) { | ||
return getPatchedWindow$LWS(shared$LWS.ReflectApply(getter$LWS, rawWindow$LWS, [])); | ||
return getPatchedWindow$LWS(shared$LWS.ReflectApply(getter$LWS, win$LWS, [])); | ||
} | ||
@@ -623,14 +886,7 @@ | ||
const unsafePostMessageDesc$LWS = shared$LWS.ReflectGetOwnPropertyDescriptor(rawWindow$LWS, 'postMessage'); | ||
const unsafePostMessageDesc$LWS = shared$LWS.ReflectGetOwnPropertyDescriptor(win$LWS, 'postMessage'); | ||
if (unsafePostMessageDesc$LWS) { | ||
const safeDesc$LWS = shared$LWS.toSafeDescriptor(unsafePostMessageDesc$LWS); | ||
const { | ||
value: originalPostMessage$LWS | ||
} = safeDesc$LWS; | ||
if (typeof originalPostMessage$LWS === 'function') { | ||
safeDesc$LWS.value = getPatchedPostMessage$LWS(originalPostMessage$LWS, rawWindow$LWS); | ||
} | ||
safeDesc$LWS.value = getPatchedPostMessage$LWS(win$LWS); | ||
shared$LWS.ReflectDefineProperty(patchedWindow$LWS, 'postMessage', safeDesc$LWS); | ||
@@ -642,29 +898,31 @@ } | ||
function getPatchedPostMessage$LWS(originalValue$LWS, rawWindow$LWS) { | ||
function getPatchedPostMessage$LWS(win$LWS) { | ||
const { | ||
postMessage: originalPostMessage$LWS | ||
} = win$LWS; | ||
return function postMessage$LWS(...args$LWS) { | ||
const message$LWS = args$LWS.length ? args$LWS[0] : undefined; | ||
if (shared$LWS.isObject(message$LWS)) { | ||
try { | ||
args$LWS[0] = JSONClone$LWS(message$LWS); | ||
} catch (_unused$LWS) { | ||
// eslint-disable-next-line @typescript-eslint/no-throw-literal | ||
throw new DOMException('The object could not be cloned.'); | ||
} | ||
if (args$LWS.length) { | ||
// Structured clone all arguments so that `transfer` is referenced | ||
// correctly within `message`. | ||
args$LWS = partialStructuredClone$LWS(args$LWS); | ||
} | ||
return shared$LWS.ReflectApply(originalValue$LWS, rawWindow$LWS, args$LWS); | ||
return shared$LWS.ReflectApply(originalPostMessage$LWS, win$LWS, args$LWS); | ||
}; | ||
} | ||
} // istanbul ignore next | ||
const { | ||
decodeURIComponent: WindowDecodeURIComponent$LWS, | ||
encodeURIComponent: WindowEncodeURIComponent$LWS | ||
} = window; | ||
function isWindowLike$LWS(value$LWS) { | ||
// fast check to narrow down when to do the slow check for window objects | ||
// window.top is unforgeable, this means this check should be safe from | ||
// user-intervention to try to bypass this check. | ||
return shared$LWS.ObjectHasOwnProperty(value$LWS, 'top'); | ||
function getPatchedWindow$LWS(win$LWS) { | ||
let patchedContentWindow$LWS = null; | ||
if (win$LWS) { | ||
patchedContentWindow$LWS = shared$LWS.WeakMapGet(rawToPatchedWindowMap$LWS, win$LWS); | ||
if (patchedContentWindow$LWS === undefined) { | ||
patchedContentWindow$LWS = createPatchedWindow$LWS(win$LWS); | ||
shared$LWS.WeakMapSet(rawToPatchedWindowMap$LWS, win$LWS, patchedContentWindow$LWS); | ||
} | ||
} | ||
return patchedContentWindow$LWS; | ||
} | ||
@@ -687,2 +945,25 @@ | ||
return false; | ||
} | ||
function isWindowLike$LWS(value$LWS) { | ||
// fast check to narrow down when to do the slow check for window objects | ||
// window.top is unforgeable, this means this check should be safe from | ||
// user-intervention to try to bypass this check. | ||
return shared$LWS.ObjectHasOwnProperty(value$LWS, 'top'); | ||
} | ||
function WindowClearInterval$LWS(win$LWS, intervalID$LWS) { | ||
return shared$LWS.ReflectApply(WindowStaticClearInterval$LWS, win$LWS, [intervalID$LWS]); | ||
} | ||
function WindowLengthGetter$LWS(win$LWS) { | ||
return shared$LWS.ReflectApply(WindowStaticLengthGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSelfGetter$LWS(win$LWS) { | ||
return shared$LWS.ReflectApply(WindowStaticSelfGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSetInterval$LWS(win$LWS, ...args$LWS) { | ||
return shared$LWS.ReflectApply(WindowStaticSetInterval$LWS, win$LWS, args$LWS); | ||
} // This has to be done 1-by-1 because putting a full file ignore in this file will result in | ||
@@ -756,5 +1037,7 @@ // dist/index.js containing the directive and subsequently being ignored. | ||
exports.ElementClosest = ElementClosest$LWS; | ||
exports.ElementGetAttribute = ElementGetAttribute$LWS; | ||
exports.ElementGetAttributeNode = ElementGetAttributeNode$LWS; | ||
exports.ElementGetAttributeNodeNS = ElementGetAttributeNodeNS$LWS; | ||
exports.ElementGetNamespaceURI = ElementGetNamespaceURI$LWS; | ||
exports.ElementHasAttribute = ElementHasAttribute$LWS; | ||
exports.ElementInnerHTMLGetter = ElementInnerHTMLGetter$LWS; | ||
@@ -766,3 +1049,2 @@ exports.ElementInnerHTMLSetter = ElementInnerHTMLSetter$LWS; | ||
exports.ElementQuerySelector = ElementQuerySelector$LWS; | ||
exports.ElementRemove = ElementRemove$LWS; | ||
exports.ElementRemoveAttributeNode = ElementRemoveAttributeNode$LWS; | ||
@@ -779,4 +1061,2 @@ exports.ElementSetAttribute = ElementSetAttribute$LWS; | ||
exports.HTMLElementDatasetGetter = HTMLElementDatasetGetter$LWS; | ||
exports.HTMLElementStyleGetter = HTMLElementStyleGetter$LWS; | ||
exports.HTMLIFrameElementContentWindowGetter = HTMLIFrameElementContentWindowGetter$LWS; | ||
exports.HTMLIFrameElementSrcSetter = HTMLIFrameElementSrcSetter$LWS; | ||
@@ -786,3 +1066,2 @@ exports.HTMLScriptElementProtoSrcGetter = HTMLScriptElementProtoSrcGetter$LWS; | ||
exports.HTMLTemplateElementContentGetter = HTMLTemplateElementContentGetter$LWS; | ||
exports.JSONClone = JSONClone$LWS; | ||
exports.NAMESPACE_DEFAULT = NAMESPACE_DEFAULT$LWS; | ||
@@ -797,3 +1076,2 @@ exports.NAMESPACE_SVG = NAMESPACE_SVG$LWS; | ||
exports.NodeIsEqualNode = NodeIsEqualNode$LWS; | ||
exports.NodeLastChildGetter = NodeLastChildGetter$LWS; | ||
exports.NodeNameGetter = NodeNameGetter$LWS; | ||
@@ -829,3 +1107,4 @@ exports.NodeOwnerDocumentGetter = NodeOwnerDocumentGetter$LWS; | ||
exports.nsCookieRootKey = nsCookieRootKey$LWS; | ||
exports.partialStructuredClone = partialStructuredClone$LWS; | ||
exports.transformUncompiledSource = transformUncompiledSource$LWS; | ||
/*! version: 0.15.10 */ | ||
/*! version: 0.15.11 */ |
/*! | ||
* Copyright (C) 2019 salesforce.com, inc. | ||
*/ | ||
import { ObjectLookupOwnGetter as ObjectLookupOwnGetter$LWS, ReflectGetOwnPropertyDescriptor as ReflectGetOwnPropertyDescriptor$LWS, ReflectApply as ReflectApply$LWS, StringToUpperCase as StringToUpperCase$LWS, WeakMapCtor as WeakMapCtor$LWS, WeakMapGet as WeakMapGet$LWS, WeakMapSet as WeakMapSet$LWS, JSONParse as JSONParse$LWS, JSONStringify as JSONStringify$LWS, StringIncludes as StringIncludes$LWS, SANDBOX_EVAL_CONTEXT_NAME as SANDBOX_EVAL_CONTEXT_NAME$LWS, StringReplace as StringReplace$LWS, UNCOMPILED_LOCATION_NAME as UNCOMPILED_LOCATION_NAME$LWS, StringToLowerCase as StringToLowerCase$LWS, ObjectLookupOwnSetter as ObjectLookupOwnSetter$LWS, toSafeDescriptor as toSafeDescriptor$LWS, FunctionBind as FunctionBind$LWS, ReflectDefineProperty as ReflectDefineProperty$LWS, isObject as isObject$LWS, ObjectHasOwnProperty as ObjectHasOwnProperty$LWS } from '@locker/shared'; | ||
import { ObjectLookupOwnGetter as ObjectLookupOwnGetter$LWS, ReflectGetOwnPropertyDescriptor as ReflectGetOwnPropertyDescriptor$LWS, ReflectApply as ReflectApply$LWS, StringToUpperCase as StringToUpperCase$LWS, WeakMapCtor as WeakMapCtor$LWS, WeakMapGet as WeakMapGet$LWS, WeakMapSet as WeakMapSet$LWS, StringIncludes as StringIncludes$LWS, SANDBOX_EVAL_CONTEXT_NAME as SANDBOX_EVAL_CONTEXT_NAME$LWS, StringReplace as StringReplace$LWS, UNCOMPILED_LOCATION_NAME as UNCOMPILED_LOCATION_NAME$LWS, StringToLowerCase as StringToLowerCase$LWS, MapCtor as MapCtor$LWS, MapClear as MapClear$LWS, ArrayShift as ArrayShift$LWS, MapGet as MapGet$LWS, getBrand as getBrand$LWS, TO_STRING_BRAND_SET as TO_STRING_BRAND_SET$LWS, TO_STRING_BRAND_MAP as TO_STRING_BRAND_MAP$LWS, TO_STRING_BRAND_ARRAY as TO_STRING_BRAND_ARRAY$LWS, ArrayCtor as ArrayCtor$LWS, TO_STRING_BRAND_OBJECT as TO_STRING_BRAND_OBJECT$LWS, ReflectGetPrototypeOf as ReflectGetPrototypeOf$LWS, ObjectProto as ObjectProto$LWS, isNearMembrane as isNearMembrane$LWS, MapSet as MapSet$LWS, TO_STRING_BRAND_STRING as TO_STRING_BRAND_STRING$LWS, ObjectCtor as ObjectCtor$LWS, getNearMembraneSerializedValue as getNearMembraneSerializedValue$LWS, TO_STRING_BRAND_BIG_INT as TO_STRING_BRAND_BIG_INT$LWS, TO_STRING_BRAND_NUMBER as TO_STRING_BRAND_NUMBER$LWS, TO_STRING_BRAND_BOOLEAN as TO_STRING_BRAND_BOOLEAN$LWS, TO_STRING_BRAND_REG_EXP as TO_STRING_BRAND_REG_EXP$LWS, RegExpCtor as RegExpCtor$LWS, MapEntries as MapEntries$LWS, ArrayPush as ArrayPush$LWS, JSONParse as JSONParse$LWS, SetCtor as SetCtor$LWS, SetValues as SetValues$LWS, SetAdd as SetAdd$LWS, ObjectKeys as ObjectKeys$LWS, ObjectLookupOwnSetter as ObjectLookupOwnSetter$LWS, ObjectHasOwnProperty as ObjectHasOwnProperty$LWS, toSafeDescriptor as toSafeDescriptor$LWS, FunctionBind as FunctionBind$LWS, ReflectDefineProperty as ReflectDefineProperty$LWS } from '@locker/shared'; | ||
const AttrProtoNameGetter$LWS = ObjectLookupOwnGetter$LWS(Attr.prototype, 'name'); | ||
@@ -102,6 +102,7 @@ const AttrProtoNamespaceURIGetter$LWS = ObjectLookupOwnGetter$LWS(Attr.prototype, 'namespaceURI'); | ||
closest: ElementProtoClosest$LWS, | ||
getAttribute: ElementProtoGetAttribute$LWS, | ||
getAttributeNode: ElementProtoGetAttributeNode$LWS, | ||
getAttributeNodeNS: ElementProtoGetAttributeNodeNS$LWS, | ||
hasAttribute: ElementProtoHasAttribute$LWS, | ||
querySelector: ElementProtoQuerySelector$LWS, | ||
remove: ElementProtoRemove$LWS, | ||
removeAttributeNode: ElementProtoRemoveAttributeNode$LWS | ||
@@ -138,2 +139,6 @@ } = Element.prototype; | ||
function ElementGetAttribute$LWS(el$LWS, attrName$LWS) { | ||
return ReflectApply$LWS(ElementProtoGetAttribute$LWS, el$LWS, [attrName$LWS]); | ||
} | ||
function ElementGetAttributeNode$LWS(el$LWS, attrName$LWS) { | ||
@@ -147,2 +152,6 @@ return ReflectApply$LWS(ElementProtoGetAttributeNode$LWS, el$LWS, [attrName$LWS]); | ||
function ElementHasAttribute$LWS(el$LWS, attrName$LWS) { | ||
return ReflectApply$LWS(ElementProtoHasAttribute$LWS, el$LWS, [attrName$LWS]); | ||
} | ||
function ElementSetAttribute$LWS(el$LWS, name$LWS, value$LWS) { | ||
@@ -156,6 +165,2 @@ return ReflectApply$LWS(ElementProtoSetAttribute$LWS, el$LWS, [name$LWS, value$LWS]); | ||
function ElementRemove$LWS(el$LWS) { | ||
return ReflectApply$LWS(ElementProtoRemove$LWS, el$LWS, []); | ||
} | ||
function ElementRemoveAttributeNode$LWS(el$LWS, attrNode$LWS) { | ||
@@ -176,11 +181,13 @@ return ReflectApply$LWS(ElementProtoRemoveAttributeNode$LWS, el$LWS, [attrNode$LWS]); | ||
const { | ||
prototype: NodeProto$LWS | ||
} = Node; | ||
const { | ||
appendChild: NodeProtoAppendChild$LWS, | ||
cloneNode: NodeProtoCloneNode$LWS, | ||
isEqualNode: NodeProtoIsEqualNode$LWS | ||
} = Node.prototype; | ||
const NodeProtoChildNodesGetter$LWS = ObjectLookupOwnGetter$LWS(Node.prototype, 'childNodes'); | ||
const NodeProtoFirstChildGetter$LWS = ObjectLookupOwnGetter$LWS(Node.prototype, 'firstChild'); | ||
const NodeProtoLastChildGetter$LWS = ObjectLookupOwnGetter$LWS(Node.prototype, 'lastChild'); | ||
const NodeProtoNodeNameGetter$LWS = ObjectLookupOwnGetter$LWS(Node.prototype, 'nodeName'); | ||
const NodeProtoOwnerDocumentGetter$LWS = ObjectLookupOwnGetter$LWS(Node.prototype, 'ownerDocument'); | ||
} = NodeProto$LWS; | ||
const NodeProtoChildNodesGetter$LWS = ObjectLookupOwnGetter$LWS(NodeProto$LWS, 'childNodes'); | ||
const NodeProtoFirstChildGetter$LWS = ObjectLookupOwnGetter$LWS(NodeProto$LWS, 'firstChild'); | ||
const NodeProtoNodeNameGetter$LWS = ObjectLookupOwnGetter$LWS(NodeProto$LWS, 'nodeName'); | ||
const NodeProtoOwnerDocumentGetter$LWS = ObjectLookupOwnGetter$LWS(NodeProto$LWS, 'ownerDocument'); | ||
@@ -207,6 +214,2 @@ function NodeAppendChild$LWS(node$LWS, childNode$LWS) { | ||
function NodeLastChildGetter$LWS(node$LWS) { | ||
return ReflectApply$LWS(NodeProtoLastChildGetter$LWS, node$LWS, []); | ||
} | ||
function NodeNameGetter$LWS(node$LWS) { | ||
@@ -295,6 +298,2 @@ // Normalize nodeName to upper case. | ||
function JSONClone$LWS(value$LWS) { | ||
return JSONParse$LWS(JSONStringify$LWS(value$LWS)); | ||
} | ||
function transformUncompiledSource$LWS(source$LWS) { | ||
@@ -323,4 +322,4 @@ // Input `source` is uncompiled, so window.location returns null inside the sandbox. Our | ||
if (locationTransformed$LWS) { | ||
// Prepend the SANDBOX_EVAL_CONTEXT_NAME to pluck the UNCOMPILED_LOCATION_NAME only if the | ||
// source code actually uses (document|self|window).location | ||
// Prepend the SANDBOX_EVAL_CONTEXT_NAME to pluck the UNCOMPILED_LOCATION_NAME | ||
// only if the source code actually uses (document|self|window).location | ||
source$LWS = `const { ${UNCOMPILED_LOCATION_NAME$LWS} } = ${SANDBOX_EVAL_CONTEXT_NAME$LWS};${source$LWS}`; | ||
@@ -351,2 +350,304 @@ } | ||
const SEEN_OBJECTS_MAP$LWS = new MapCtor$LWS(); | ||
function cloneBoxedPrimitive$LWS(object$LWS) { | ||
return ObjectCtor$LWS(getNearMembraneSerializedValue$LWS(object$LWS)); | ||
} | ||
function cloneMap$LWS(map$LWS, queue$LWS) { | ||
// Section 2.7.3 StructuredSerializeInternal: | ||
// https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal | ||
// Step 26.1.1: Let copiedList be a new empty List. | ||
const clone$LWS = new MapCtor$LWS(); // Step 26.1.2: For each Record { [[Key]], [[Value]] } entry of value.[[MapData]]... | ||
const entriesIterable$LWS = MapEntries$LWS(map$LWS); // Step 26.1.3 For each Record { [[Key]], [[Value]] } entry of copiedList: | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
const { | ||
done: done$LWS, | ||
value: subKeyValuePair$LWS | ||
} = entriesIterable$LWS.next(); | ||
if (done$LWS) { | ||
break; | ||
} | ||
const { | ||
0: subKey$LWS, | ||
1: subValue$LWS | ||
} = subKeyValuePair$LWS; | ||
let subCloneKey$LWS; | ||
ArrayPush$LWS(queue$LWS, // Step 26.1.3.1: Let serializedKey be ? StructuredSerializeInternal(entry.[[Key]], forStorage, memory). | ||
[subClone$LWS => { | ||
subCloneKey$LWS = subClone$LWS; | ||
}, subKey$LWS], // Step 26.1.3.2: Let serializedValue be ? StructuredSerializeInternal(entry.[[Value]], forStorage, memory). | ||
[subCloneValue$LWS => { | ||
MapSet$LWS(clone$LWS, subCloneKey$LWS, subCloneValue$LWS); | ||
}, subValue$LWS]); | ||
} | ||
return clone$LWS; | ||
} | ||
function cloneRegExp$LWS(regexp$LWS) { | ||
const { | ||
flags: flags$LWS, | ||
source: source$LWS | ||
} = JSONParse$LWS(getNearMembraneSerializedValue$LWS(regexp$LWS)); | ||
return new RegExpCtor$LWS(source$LWS, flags$LWS); | ||
} | ||
function cloneSet$LWS(set$LWS, queue$LWS) { | ||
// Section 2.7.3 StructuredSerializeInternal: | ||
// https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal | ||
// Step 26.2.1: Let copiedList be a new empty List. | ||
const clone$LWS = new SetCtor$LWS(); // Step 26.2.2: For each entry of value.[[SetData]]... | ||
const valuesIterable$LWS = SetValues$LWS(set$LWS); // Step 26.2.3: For each entry of copiedList: | ||
// eslint-disable-next-line no-constant-condition | ||
while (true) { | ||
const { | ||
done: done$LWS, | ||
value: subValue$LWS | ||
} = valuesIterable$LWS.next(); | ||
if (done$LWS) { | ||
break; | ||
} | ||
ArrayPush$LWS(queue$LWS, // Step 26.2.3.1: Let serializedEntry be ? StructuredSerializeInternal(entry, forStorage, memory). | ||
[subCloneValue$LWS => { | ||
SetAdd$LWS(clone$LWS, subCloneValue$LWS); | ||
}, subValue$LWS]); | ||
} | ||
return clone$LWS; | ||
} | ||
function enqueue$LWS(queue$LWS, originalValue$LWS, cloneValue$LWS) { | ||
// Section 2.7.3 StructuredSerializeInternal: | ||
// https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal | ||
// Step 26.4: Otherwise, for each key in ! EnumerableOwnPropertyNames(value, key)... | ||
// Note: Object.keys() performs EnumerableOwnPropertyNames() internally as | ||
// defined in ECMA262: | ||
// https://tc39.es/ecma262/#sec-object.keys | ||
const keys$LWS = ObjectKeys$LWS(originalValue$LWS); | ||
for (let i$LWS = 0, { | ||
length: length$LWS | ||
} = keys$LWS; i$LWS < length$LWS; i$LWS += 1) { | ||
// Step 26.4.1.1: Let inputValue be ? value.[[Get]](key, value). | ||
// The [[Get]] operation is defined in ECMA262 for ordinary objects, | ||
// argument objects, integer-indexed exotic objects, module namespace | ||
// objects, and proxy objects. | ||
// https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-get-p-receiver | ||
const key$LWS = keys$LWS[i$LWS]; | ||
const subValue$LWS = originalValue$LWS[key$LWS]; | ||
ArrayPush$LWS(queue$LWS, [subCloneValue$LWS => { | ||
// Step 26.4.1.3: Property descriptor attributes are not | ||
// preserved during deserialization because only keys and | ||
// values are captured in serialized.[[Properties]]. | ||
cloneValue$LWS[key$LWS] = subCloneValue$LWS; | ||
}, subValue$LWS]); | ||
} | ||
} // This function is the unguarded internal variant of `partialStructuredClone()`. | ||
// Any error thrown that is captured by `partialStructuredClone()` is treated as | ||
// a `DataCloneError`. This function clones blue membrane proxied arrays, plain | ||
// objects, maps, regexps, sets, and boxed primitives. The following non-membrane | ||
// proxied objects are set by reference instead of cloning: | ||
// ArrayBuffer | ||
// BigInt64Array | ||
// BigUint64Array | ||
// Blob | ||
// DataView | ||
// Date | ||
// DOMException | ||
// DOMMatrix | ||
// DOMMatrixReadOnly | ||
// DOMPoint | ||
// DOMPointReadOnly | ||
// DOMQuad | ||
// DOMRect | ||
// DOMRectReadOnly | ||
// Error | ||
// EvalError | ||
// File | ||
// FileList | ||
// Float32Array | ||
// Float64Array | ||
// ImageBitMap | ||
// ImageData | ||
// Int8Array | ||
// Int16Array | ||
// Int32Array | ||
// RangeError | ||
// ReferenceError | ||
// SyntaxError | ||
// TypeError | ||
// Uint8Array | ||
// Uint8ClampedArray | ||
// Uint16Array | ||
// Uint32Array | ||
// URIError | ||
// | ||
// Note: | ||
// This function performs brand checks using `Object.prototype.toString`. The | ||
// results can be faked with `Symbol.toStringTag` property values and are a poor | ||
// substitute for native internal slot checks. However, for our purposes they | ||
// are perfectly fine and avoid having to repeatedly walk the prototype of proxied | ||
// values. Cloned values should be passed to native methods, like `postMessage()`, | ||
// which perform their own validation with internal slot checks. | ||
function partialStructuredCloneInternal$LWS(value$LWS) { | ||
// Using a queue instead of recursive function calls avoids call stack limits | ||
// and enables cloning more complex and deeply nested objects. | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Too_much_recursion | ||
let result$LWS; | ||
const queue$LWS = [[subClone$LWS => { | ||
result$LWS = subClone$LWS; | ||
}, value$LWS]]; // eslint-disable-next-line no-labels | ||
queueLoop: while (queue$LWS.length) { | ||
// Section 2.7.3 StructuredSerializeInternal: | ||
// https://html.spec.whatwg.org/multipage/structured-data.html#structuredserializeinternal | ||
// prettier-ignore | ||
const { | ||
0: setter$LWS, | ||
1: originalValue$LWS | ||
} = ArrayShift$LWS(queue$LWS); // Step 4: If Type(value) is Undefined, Null, Boolean, Number, BigInt, or String | ||
if (originalValue$LWS === null || originalValue$LWS === undefined || typeof originalValue$LWS === 'boolean' || typeof originalValue$LWS === 'number' || typeof originalValue$LWS === 'string' || typeof originalValue$LWS === 'bigint') { | ||
setter$LWS(originalValue$LWS); // eslint-disable-next-line no-continue, no-extra-label, no-labels | ||
continue queueLoop; | ||
} // Step 5: If Type(value) is Symbol, then throw a 'DataCloneError' DOMException. | ||
if (typeof originalValue$LWS === 'symbol') { | ||
// Stop cloning and set the original value and defer throwing to | ||
// native methods. | ||
setter$LWS(originalValue$LWS); // eslint-disable-next-line no-extra-label, no-labels | ||
break queueLoop; | ||
} // To support circular references check if the original value has been | ||
// seen. If it has then use the clone associated with its record instead | ||
// of creating a new clone. | ||
let cloneValue$LWS = MapGet$LWS(SEEN_OBJECTS_MAP$LWS, originalValue$LWS); | ||
if (cloneValue$LWS) { | ||
setter$LWS(cloneValue$LWS); // eslint-disable-next-line no-continue, no-extra-label, no-labels | ||
continue queueLoop; | ||
} // Perform a brand check on originalValue. | ||
const brand$LWS = getBrand$LWS(originalValue$LWS); // eslint-disable-next-line default-case | ||
switch (brand$LWS) { | ||
// Step 19: Otherwise, if value is a platform object... | ||
case TO_STRING_BRAND_OBJECT$LWS: | ||
{ | ||
const proto$LWS = ReflectGetPrototypeOf$LWS(originalValue$LWS); | ||
if (proto$LWS === ObjectProto$LWS || proto$LWS === null) { | ||
cloneValue$LWS = {}; // Step 19.4: Set deep to true. | ||
enqueue$LWS(queue$LWS, originalValue$LWS, cloneValue$LWS); | ||
} | ||
break; | ||
} | ||
// Step 18: Otherwise, if value is an Array exotic object... | ||
case TO_STRING_BRAND_ARRAY$LWS: | ||
// Step 18.1 Let valueLenDescriptor be ? OrdinaryGetOwnProperty(value, 'length'). | ||
// Note: Rather than perform the more complex OrdinaryGetOwnProperty() | ||
// operation for 'length' because it is a non-configurable property | ||
// we can access it with the simpler [[Get]]() operation defined | ||
// in ECMA262. | ||
// https://tc39.es/ecma262/#sec-integer-indexed-exotic-objects-get-p-receiver | ||
cloneValue$LWS = new ArrayCtor$LWS(originalValue$LWS.length); // Step 18.4: Set deep to true. | ||
enqueue$LWS(queue$LWS, originalValue$LWS, cloneValue$LWS); | ||
break; | ||
// Step 15: Otherwise, if value has [[MapData]] internal slot... | ||
// Step 15.2: Set deep to true. | ||
case TO_STRING_BRAND_MAP$LWS: | ||
cloneValue$LWS = cloneMap$LWS(originalValue$LWS, queue$LWS); | ||
break; | ||
// Step 16: Otherwise, if value has [[SetData]] internal slot... | ||
// Step 16.2: Set deep to true. | ||
case TO_STRING_BRAND_SET$LWS: | ||
cloneValue$LWS = cloneSet$LWS(originalValue$LWS, queue$LWS); | ||
break; | ||
} | ||
if (cloneValue$LWS === undefined) { | ||
if (!isNearMembrane$LWS(originalValue$LWS)) { | ||
// Skip cloning non-membrane proxied objects. | ||
MapSet$LWS(SEEN_OBJECTS_MAP$LWS, originalValue$LWS, originalValue$LWS); | ||
setter$LWS(originalValue$LWS); // eslint-disable-next-line no-extra-label, no-labels | ||
continue queueLoop; | ||
} // Cases ordered by a guestimate on frequency of encounter. | ||
// eslint-disable-next-line default-case | ||
switch (brand$LWS) { | ||
// Step 12: Otherwise, if value has a [[RegExpMatcher]] internal slot... | ||
case TO_STRING_BRAND_REG_EXP$LWS: | ||
cloneValue$LWS = cloneRegExp$LWS(originalValue$LWS); | ||
break; | ||
// Step 7: If value has a [[BooleanData]] internal slot... | ||
case TO_STRING_BRAND_BOOLEAN$LWS: // Step 8: Otherwise, if value has a [[NumberData]] internal slot... | ||
// eslint-disable-next-line no-fallthrough | ||
case TO_STRING_BRAND_NUMBER$LWS: // Step 9: Otherwise, if value has a [[BigIntData]] internal slot... | ||
// eslint-disable-next-line no-fallthrough | ||
case TO_STRING_BRAND_BIG_INT$LWS: // Step 10: Otherwise, if value has a [[StringData]] internal slot... | ||
// eslint-disable-next-line no-fallthrough | ||
case TO_STRING_BRAND_STRING$LWS: | ||
cloneValue$LWS = cloneBoxedPrimitive$LWS(originalValue$LWS); | ||
break; | ||
} | ||
} // Step 21: Otherwise, if IsCallable(value) is true, then throw a 'DataCloneError' | ||
// Step 20: Otherwise, if value is a platform object, then throw a 'DataCloneError' | ||
if (cloneValue$LWS === undefined) { | ||
// Stop cloning and set the original value and defer throwing to | ||
// native methods. | ||
setter$LWS(originalValue$LWS); // eslint-disable-next-line no-extra-label, no-labels | ||
break queueLoop; | ||
} | ||
MapSet$LWS(SEEN_OBJECTS_MAP$LWS, originalValue$LWS, cloneValue$LWS); | ||
setter$LWS(cloneValue$LWS); | ||
} | ||
return result$LWS; | ||
} | ||
function partialStructuredClone$LWS(value$LWS) { | ||
let result$LWS = value$LWS; | ||
try { | ||
result$LWS = partialStructuredCloneInternal$LWS(value$LWS); // eslint-disable-next-line no-empty | ||
} catch (_unused$LWS) {} | ||
MapClear$LWS(SEEN_OBJECTS_MAP$LWS); | ||
return result$LWS; | ||
} | ||
const { | ||
@@ -422,3 +723,2 @@ getElementById: DocumentFragmentProtoGetElementById$LWS, | ||
const HTMLElementProtoDatasetGetter$LWS = ObjectLookupOwnGetter$LWS(HTMLElement.prototype, 'dataset'); | ||
const HTMLElementProtoStyleGetter$LWS = ObjectLookupOwnGetter$LWS(HTMLElement.prototype, 'style'); | ||
@@ -429,7 +729,2 @@ function HTMLElementDatasetGetter$LWS(el$LWS) { | ||
function HTMLElementStyleGetter$LWS(el$LWS) { | ||
return ReflectApply$LWS(HTMLElementProtoStyleGetter$LWS, el$LWS, []); | ||
} | ||
const HTMLIFrameElementProtoContentWindowGetter$LWS = ObjectLookupOwnGetter$LWS(HTMLIFrameElement.prototype, 'contentWindow'); | ||
const HTMLIFrameElementProtoSrcSetter$LWS = ObjectLookupOwnSetter$LWS(HTMLIFrameElement.prototype, 'src'); | ||
@@ -441,6 +736,2 @@ | ||
function HTMLIFrameElementContentWindowGetter$LWS(iframe$LWS) { | ||
return ReflectApply$LWS(HTMLIFrameElementProtoContentWindowGetter$LWS, iframe$LWS, []); | ||
} | ||
const { | ||
@@ -483,3 +774,5 @@ get: HTMLScriptElementProtoSrcGetter$LWS, | ||
const ALLOW_LIST_RAW$LWS = ['close', 'closed', 'focus']; | ||
const DEFAULT_OVERWRITTEN_VALUE$LWS = {}; // These properties are part of the WindowOrGlobalScope mixin and not on Window.prototype. | ||
const DEFAULT_OVERWRITTEN_VALUE$LWS = {}; | ||
const rawToPatchedWindowMap$LWS = new WeakMapCtor$LWS(); // These properties are part of the WindowOrGlobalScope mixin and not on | ||
// Window.prototype. | ||
// https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope | ||
@@ -493,38 +786,8 @@ | ||
const WindowStaticSelfGetter$LWS = ObjectLookupOwnGetter$LWS(window, 'self'); | ||
const { | ||
decodeURIComponent: WindowDecodeURIComponent$LWS, | ||
encodeURIComponent: WindowEncodeURIComponent$LWS | ||
} = window; // istanbul ignore next | ||
function WindowClearInterval$LWS(win$LWS, intervalID$LWS) { | ||
return ReflectApply$LWS(WindowStaticClearInterval$LWS, win$LWS, [intervalID$LWS]); | ||
} | ||
function WindowLengthGetter$LWS(win$LWS) { | ||
return ReflectApply$LWS(WindowStaticLengthGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSelfGetter$LWS(win$LWS) { | ||
return ReflectApply$LWS(WindowStaticSelfGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSetInterval$LWS(win$LWS, ...args$LWS) { | ||
return ReflectApply$LWS(WindowStaticSetInterval$LWS, win$LWS, args$LWS); | ||
} | ||
const patchedWindowMap$LWS = new WeakMapCtor$LWS(); // istanbul ignore next | ||
function getPatchedWindow$LWS(win$LWS) { | ||
let patchedContentWindow$LWS = null; | ||
if (win$LWS !== null) { | ||
patchedContentWindow$LWS = WeakMapGet$LWS(patchedWindowMap$LWS, win$LWS); | ||
if (!patchedContentWindow$LWS) { | ||
patchedContentWindow$LWS = createPatchedWindow$LWS(win$LWS); | ||
WeakMapSet$LWS(patchedWindowMap$LWS, win$LWS, patchedContentWindow$LWS); | ||
} | ||
} | ||
return patchedContentWindow$LWS; | ||
} // istanbul ignore next | ||
function createPatchedWindow$LWS(rawWindow$LWS) { | ||
function createPatchedWindow$LWS(win$LWS) { | ||
const patchedWindow$LWS = {}; | ||
@@ -536,3 +799,3 @@ | ||
const key$LWS = ALLOW_LIST_RAW$LWS[i$LWS]; | ||
const unsafeDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(rawWindow$LWS, key$LWS); | ||
const unsafeDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(win$LWS, key$LWS); | ||
@@ -546,3 +809,3 @@ if (unsafeDesc$LWS) { | ||
if (typeof originalValue$LWS === 'function') { | ||
const bound$LWS = FunctionBind$LWS(originalValue$LWS, rawWindow$LWS); | ||
const bound$LWS = FunctionBind$LWS(originalValue$LWS, win$LWS); | ||
const unsafeNameDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(originalValue$LWS, 'name'); | ||
@@ -564,3 +827,3 @@ | ||
safeDesc$LWS.get = function get$LWS() { | ||
return overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS ? ReflectApply$LWS(getter$LWS, rawWindow$LWS, []) : overwrittenValue$LWS; | ||
return overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS ? ReflectApply$LWS(getter$LWS, win$LWS, []) : overwrittenValue$LWS; | ||
}; | ||
@@ -584,3 +847,3 @@ } | ||
const key$LWS = ALLOW_LIST_PATCHED$LWS[i$LWS]; | ||
const unsafeDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(rawWindow$LWS, key$LWS); | ||
const unsafeDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(win$LWS, key$LWS); | ||
@@ -598,3 +861,3 @@ if (unsafeDesc$LWS) { | ||
if (overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS) { | ||
return getPatchedWindow$LWS(ReflectApply$LWS(getter$LWS, rawWindow$LWS, [])); | ||
return getPatchedWindow$LWS(ReflectApply$LWS(getter$LWS, win$LWS, [])); | ||
} | ||
@@ -616,14 +879,7 @@ | ||
const unsafePostMessageDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(rawWindow$LWS, 'postMessage'); | ||
const unsafePostMessageDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(win$LWS, 'postMessage'); | ||
if (unsafePostMessageDesc$LWS) { | ||
const safeDesc$LWS = toSafeDescriptor$LWS(unsafePostMessageDesc$LWS); | ||
const { | ||
value: originalPostMessage$LWS | ||
} = safeDesc$LWS; | ||
if (typeof originalPostMessage$LWS === 'function') { | ||
safeDesc$LWS.value = getPatchedPostMessage$LWS(originalPostMessage$LWS, rawWindow$LWS); | ||
} | ||
safeDesc$LWS.value = getPatchedPostMessage$LWS(win$LWS); | ||
ReflectDefineProperty$LWS(patchedWindow$LWS, 'postMessage', safeDesc$LWS); | ||
@@ -635,29 +891,31 @@ } | ||
function getPatchedPostMessage$LWS(originalValue$LWS, rawWindow$LWS) { | ||
function getPatchedPostMessage$LWS(win$LWS) { | ||
const { | ||
postMessage: originalPostMessage$LWS | ||
} = win$LWS; | ||
return function postMessage$LWS(...args$LWS) { | ||
const message$LWS = args$LWS.length ? args$LWS[0] : undefined; | ||
if (isObject$LWS(message$LWS)) { | ||
try { | ||
args$LWS[0] = JSONClone$LWS(message$LWS); | ||
} catch (_unused$LWS) { | ||
// eslint-disable-next-line @typescript-eslint/no-throw-literal | ||
throw new DOMException('The object could not be cloned.'); | ||
} | ||
if (args$LWS.length) { | ||
// Structured clone all arguments so that `transfer` is referenced | ||
// correctly within `message`. | ||
args$LWS = partialStructuredClone$LWS(args$LWS); | ||
} | ||
return ReflectApply$LWS(originalValue$LWS, rawWindow$LWS, args$LWS); | ||
return ReflectApply$LWS(originalPostMessage$LWS, win$LWS, args$LWS); | ||
}; | ||
} | ||
} // istanbul ignore next | ||
const { | ||
decodeURIComponent: WindowDecodeURIComponent$LWS, | ||
encodeURIComponent: WindowEncodeURIComponent$LWS | ||
} = window; | ||
function isWindowLike$LWS(value$LWS) { | ||
// fast check to narrow down when to do the slow check for window objects | ||
// window.top is unforgeable, this means this check should be safe from | ||
// user-intervention to try to bypass this check. | ||
return ObjectHasOwnProperty$LWS(value$LWS, 'top'); | ||
function getPatchedWindow$LWS(win$LWS) { | ||
let patchedContentWindow$LWS = null; | ||
if (win$LWS) { | ||
patchedContentWindow$LWS = WeakMapGet$LWS(rawToPatchedWindowMap$LWS, win$LWS); | ||
if (patchedContentWindow$LWS === undefined) { | ||
patchedContentWindow$LWS = createPatchedWindow$LWS(win$LWS); | ||
WeakMapSet$LWS(rawToPatchedWindowMap$LWS, win$LWS, patchedContentWindow$LWS); | ||
} | ||
} | ||
return patchedContentWindow$LWS; | ||
} | ||
@@ -680,2 +938,25 @@ | ||
return false; | ||
} | ||
function isWindowLike$LWS(value$LWS) { | ||
// fast check to narrow down when to do the slow check for window objects | ||
// window.top is unforgeable, this means this check should be safe from | ||
// user-intervention to try to bypass this check. | ||
return ObjectHasOwnProperty$LWS(value$LWS, 'top'); | ||
} | ||
function WindowClearInterval$LWS(win$LWS, intervalID$LWS) { | ||
return ReflectApply$LWS(WindowStaticClearInterval$LWS, win$LWS, [intervalID$LWS]); | ||
} | ||
function WindowLengthGetter$LWS(win$LWS) { | ||
return ReflectApply$LWS(WindowStaticLengthGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSelfGetter$LWS(win$LWS) { | ||
return ReflectApply$LWS(WindowStaticSelfGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSetInterval$LWS(win$LWS, ...args$LWS) { | ||
return ReflectApply$LWS(WindowStaticSetInterval$LWS, win$LWS, args$LWS); | ||
} // This has to be done 1-by-1 because putting a full file ignore in this file will result in | ||
@@ -725,3 +1006,3 @@ // dist/index.js containing the directive and subsequently being ignored. | ||
export { AttrNameGetter$LWS as AttrNameGetter, AttrNamespaceURIGetter$LWS as AttrNamespaceURIGetter, AttrOwnerElementGetter$LWS as AttrOwnerElementGetter, AttrValueGetter$LWS as AttrValueGetter, AttrValueSetter$LWS as AttrValueSetter, BlobCtor$LWS as BlobCtor, BlobSizeGetter$LWS as BlobSizeGetter, BlobSlice$LWS as BlobSlice, BlobTypeGetter$LWS as BlobTypeGetter, DOMImplementationCreateDocument$LWS as DOMImplementationCreateDocument, DOMTokenListValueGetter$LWS as DOMTokenListValueGetter, DocumentBodyGetter$LWS as DocumentBodyGetter, DocumentCookieGetter$LWS as DocumentCookieGetter, DocumentCookieSetter$LWS as DocumentCookieSetter, DocumentCreateComment$LWS as DocumentCreateComment, DocumentCreateElement$LWS as DocumentCreateElement, DocumentCreateElementNS$LWS as DocumentCreateElementNS, DocumentDocumentElementGetter$LWS as DocumentDocumentElementGetter, DocumentFragmentGetElementById$LWS as DocumentFragmentGetElementById, DocumentFragmentQuerySelector$LWS as DocumentFragmentQuerySelector, DocumentGetElementById$LWS as DocumentGetElementById, DocumentHeadGetter$LWS as DocumentHeadGetter, DocumentImplementation$LWS as DocumentImplementation, ElementClosest$LWS as ElementClosest, ElementGetAttributeNode$LWS as ElementGetAttributeNode, ElementGetAttributeNodeNS$LWS as ElementGetAttributeNodeNS, ElementGetNamespaceURI$LWS as ElementGetNamespaceURI, ElementInnerHTMLGetter$LWS as ElementInnerHTMLGetter, ElementInnerHTMLSetter$LWS as ElementInnerHTMLSetter, ElementOuterHTMLGetter$LWS as ElementOuterHTMLGetter, ElementProtoSetAttribute$LWS as ElementProtoSetAttribute, ElementProtoSetAttributeNS$LWS as ElementProtoSetAttributeNS, ElementQuerySelector$LWS as ElementQuerySelector, ElementRemove$LWS as ElementRemove, ElementRemoveAttributeNode$LWS as ElementRemoveAttributeNode, ElementSetAttribute$LWS as ElementSetAttribute, ElementSetAttributeNS$LWS as ElementSetAttributeNS, EventCurrentTargetGetter$LWS as EventCurrentTargetGetter, EventTargetAddEventListener$LWS as EventTargetAddEventListener, HTMLAnchorElementHostnameGetter$LWS as HTMLAnchorElementHostnameGetter, HTMLAnchorElementHrefGetter$LWS as HTMLAnchorElementHrefGetter, HTMLAnchorElementHrefSetter$LWS as HTMLAnchorElementHrefSetter, HTMLAnchorElementPathnameGetter$LWS as HTMLAnchorElementPathnameGetter, HTMLAnchorElementProtocolGetter$LWS as HTMLAnchorElementProtocolGetter, HTMLElementDatasetGetter$LWS as HTMLElementDatasetGetter, HTMLElementStyleGetter$LWS as HTMLElementStyleGetter, HTMLIFrameElementContentWindowGetter$LWS as HTMLIFrameElementContentWindowGetter, HTMLIFrameElementSrcSetter$LWS as HTMLIFrameElementSrcSetter, HTMLScriptElementProtoSrcGetter$LWS as HTMLScriptElementProtoSrcGetter, HTMLScriptElementProtoSrcSetter$LWS as HTMLScriptElementProtoSrcSetter, HTMLTemplateElementContentGetter$LWS as HTMLTemplateElementContentGetter, JSONClone$LWS as JSONClone, NAMESPACE_DEFAULT$LWS as NAMESPACE_DEFAULT, NAMESPACE_SVG$LWS as NAMESPACE_SVG, NAMESPACE_XHTML$LWS as NAMESPACE_XHTML, NAMESPACE_XLINK$LWS as NAMESPACE_XLINK, NodeAppendChild$LWS as NodeAppendChild, NodeChildNodesGetter$LWS as NodeChildNodesGetter, NodeClone$LWS as NodeClone, NodeFirstChildGetter$LWS as NodeFirstChildGetter, NodeIsEqualNode$LWS as NodeIsEqualNode, NodeLastChildGetter$LWS as NodeLastChildGetter, NodeNameGetter$LWS as NodeNameGetter, NodeOwnerDocumentGetter$LWS as NodeOwnerDocumentGetter, RangeProtoCreateContextualFragment$LWS as RangeProtoCreateContextualFragment, RequestURLGetter$LWS as RequestURLGetter, SVGElementDatasetGetter$LWS as SVGElementDatasetGetter, StorageProtoGetItem$LWS as StorageProtoGetItem, StorageProtoKey$LWS as StorageProtoKey, StorageProtoRemoveItem$LWS as StorageProtoRemoveItem, StorageProtoSetItem$LWS as StorageProtoSetItem, URLCreateObjectURL$LWS as URLCreateObjectURL, URLRevokeObjectURL$LWS as URLRevokeObjectURL, WindowClearInterval$LWS as WindowClearInterval, WindowDecodeURIComponent$LWS as WindowDecodeURIComponent, WindowEncodeURIComponent$LWS as WindowEncodeURIComponent, WindowLengthGetter$LWS as WindowLengthGetter, WindowSelfGetter$LWS as WindowSelfGetter, WindowSetInterval$LWS as WindowSetInterval, XhrCtor$LWS as XhrCtor, XhrOpen$LWS as XhrOpen, XhrResponseTextGetter$LWS as XhrResponseTextGetter, XhrSend$LWS as XhrSend, XhrStatusGetter$LWS as XhrStatusGetter, XhrWithCredentialsSetter$LWS as XhrWithCredentialsSetter, getPatchedPostMessage$LWS as getPatchedPostMessage, getPatchedWindow$LWS as getPatchedWindow, getValidator$LWS as getValidator, isWindow$LWS as isWindow, isWindowLike$LWS as isWindowLike, nsCookieKey$LWS as nsCookieKey, nsCookieRootKey$LWS as nsCookieRootKey, transformUncompiledSource$LWS as transformUncompiledSource }; | ||
/*! version: 0.15.10 */ | ||
export { AttrNameGetter$LWS as AttrNameGetter, AttrNamespaceURIGetter$LWS as AttrNamespaceURIGetter, AttrOwnerElementGetter$LWS as AttrOwnerElementGetter, AttrValueGetter$LWS as AttrValueGetter, AttrValueSetter$LWS as AttrValueSetter, BlobCtor$LWS as BlobCtor, BlobSizeGetter$LWS as BlobSizeGetter, BlobSlice$LWS as BlobSlice, BlobTypeGetter$LWS as BlobTypeGetter, DOMImplementationCreateDocument$LWS as DOMImplementationCreateDocument, DOMTokenListValueGetter$LWS as DOMTokenListValueGetter, DocumentBodyGetter$LWS as DocumentBodyGetter, DocumentCookieGetter$LWS as DocumentCookieGetter, DocumentCookieSetter$LWS as DocumentCookieSetter, DocumentCreateComment$LWS as DocumentCreateComment, DocumentCreateElement$LWS as DocumentCreateElement, DocumentCreateElementNS$LWS as DocumentCreateElementNS, DocumentDocumentElementGetter$LWS as DocumentDocumentElementGetter, DocumentFragmentGetElementById$LWS as DocumentFragmentGetElementById, DocumentFragmentQuerySelector$LWS as DocumentFragmentQuerySelector, DocumentGetElementById$LWS as DocumentGetElementById, DocumentHeadGetter$LWS as DocumentHeadGetter, DocumentImplementation$LWS as DocumentImplementation, ElementClosest$LWS as ElementClosest, ElementGetAttribute$LWS as ElementGetAttribute, ElementGetAttributeNode$LWS as ElementGetAttributeNode, ElementGetAttributeNodeNS$LWS as ElementGetAttributeNodeNS, ElementGetNamespaceURI$LWS as ElementGetNamespaceURI, ElementHasAttribute$LWS as ElementHasAttribute, ElementInnerHTMLGetter$LWS as ElementInnerHTMLGetter, ElementInnerHTMLSetter$LWS as ElementInnerHTMLSetter, ElementOuterHTMLGetter$LWS as ElementOuterHTMLGetter, ElementProtoSetAttribute$LWS as ElementProtoSetAttribute, ElementProtoSetAttributeNS$LWS as ElementProtoSetAttributeNS, ElementQuerySelector$LWS as ElementQuerySelector, ElementRemoveAttributeNode$LWS as ElementRemoveAttributeNode, ElementSetAttribute$LWS as ElementSetAttribute, ElementSetAttributeNS$LWS as ElementSetAttributeNS, EventCurrentTargetGetter$LWS as EventCurrentTargetGetter, EventTargetAddEventListener$LWS as EventTargetAddEventListener, HTMLAnchorElementHostnameGetter$LWS as HTMLAnchorElementHostnameGetter, HTMLAnchorElementHrefGetter$LWS as HTMLAnchorElementHrefGetter, HTMLAnchorElementHrefSetter$LWS as HTMLAnchorElementHrefSetter, HTMLAnchorElementPathnameGetter$LWS as HTMLAnchorElementPathnameGetter, HTMLAnchorElementProtocolGetter$LWS as HTMLAnchorElementProtocolGetter, HTMLElementDatasetGetter$LWS as HTMLElementDatasetGetter, HTMLIFrameElementSrcSetter$LWS as HTMLIFrameElementSrcSetter, HTMLScriptElementProtoSrcGetter$LWS as HTMLScriptElementProtoSrcGetter, HTMLScriptElementProtoSrcSetter$LWS as HTMLScriptElementProtoSrcSetter, HTMLTemplateElementContentGetter$LWS as HTMLTemplateElementContentGetter, NAMESPACE_DEFAULT$LWS as NAMESPACE_DEFAULT, NAMESPACE_SVG$LWS as NAMESPACE_SVG, NAMESPACE_XHTML$LWS as NAMESPACE_XHTML, NAMESPACE_XLINK$LWS as NAMESPACE_XLINK, NodeAppendChild$LWS as NodeAppendChild, NodeChildNodesGetter$LWS as NodeChildNodesGetter, NodeClone$LWS as NodeClone, NodeFirstChildGetter$LWS as NodeFirstChildGetter, NodeIsEqualNode$LWS as NodeIsEqualNode, NodeNameGetter$LWS as NodeNameGetter, NodeOwnerDocumentGetter$LWS as NodeOwnerDocumentGetter, RangeProtoCreateContextualFragment$LWS as RangeProtoCreateContextualFragment, RequestURLGetter$LWS as RequestURLGetter, SVGElementDatasetGetter$LWS as SVGElementDatasetGetter, StorageProtoGetItem$LWS as StorageProtoGetItem, StorageProtoKey$LWS as StorageProtoKey, StorageProtoRemoveItem$LWS as StorageProtoRemoveItem, StorageProtoSetItem$LWS as StorageProtoSetItem, URLCreateObjectURL$LWS as URLCreateObjectURL, URLRevokeObjectURL$LWS as URLRevokeObjectURL, WindowClearInterval$LWS as WindowClearInterval, WindowDecodeURIComponent$LWS as WindowDecodeURIComponent, WindowEncodeURIComponent$LWS as WindowEncodeURIComponent, WindowLengthGetter$LWS as WindowLengthGetter, WindowSelfGetter$LWS as WindowSelfGetter, WindowSetInterval$LWS as WindowSetInterval, XhrCtor$LWS as XhrCtor, XhrOpen$LWS as XhrOpen, XhrResponseTextGetter$LWS as XhrResponseTextGetter, XhrSend$LWS as XhrSend, XhrStatusGetter$LWS as XhrStatusGetter, XhrWithCredentialsSetter$LWS as XhrWithCredentialsSetter, getPatchedPostMessage$LWS as getPatchedPostMessage, getPatchedWindow$LWS as getPatchedWindow, getValidator$LWS as getValidator, isWindow$LWS as isWindow, isWindowLike$LWS as isWindowLike, nsCookieKey$LWS as nsCookieKey, nsCookieRootKey$LWS as nsCookieRootKey, partialStructuredClone$LWS as partialStructuredClone, transformUncompiledSource$LWS as transformUncompiledSource }; | ||
/*! version: 0.15.11 */ |
{ | ||
"name": "@locker/shared-dom", | ||
"version": "0.15.10", | ||
"version": "0.15.11", | ||
"license": "Salesforce Developer Agreement", | ||
@@ -20,3 +20,3 @@ "author": "Salesforce UI Security Team", | ||
"dependencies": { | ||
"@locker/shared": "0.15.10" | ||
"@locker/shared": "0.15.11" | ||
}, | ||
@@ -27,3 +27,3 @@ "files": [ | ||
], | ||
"gitHead": "36a7ff5b9ae15c80f8f773b2882f96eab0511737" | ||
"gitHead": "6d56b0bea767c6509221db7b49fbcc72f2557edb" | ||
} |
import { GlobalObject } from './types'; | ||
export declare function getValidator(globalObject: GlobalObject): any; | ||
export declare function JSONClone(value: any): any; | ||
export declare function transformUncompiledSource(source: string): string; | ||
//# sourceMappingURL=basic.d.ts.map |
@@ -7,9 +7,10 @@ export declare const ElementProtoSetAttribute: (qualifiedName: string, value: string) => void, ElementProtoSetAttributeNS: (namespace: string | null, qualifiedName: string, value: string) => void; | ||
export declare function ElementQuerySelector(el: Element, selectors: string): ReturnType<typeof Element.prototype.querySelector>; | ||
export declare function ElementGetAttribute(el: Element, attrName: string): ReturnType<typeof Element.prototype.getAttribute>; | ||
export declare function ElementGetAttributeNode(el: Element, attrName: string): ReturnType<typeof Element.prototype.getAttributeNode>; | ||
export declare function ElementGetAttributeNodeNS(el: Element, namespace: string, nodeName: string): ReturnType<typeof Element.prototype.getAttributeNodeNS>; | ||
export declare function ElementHasAttribute(el: Element, attrName: string | null): ReturnType<typeof Element.prototype.hasAttribute>; | ||
export declare function ElementSetAttribute(el: Element, name: string, value: string): ReturnType<typeof Element.prototype.setAttribute>; | ||
export declare function ElementSetAttributeNS(el: Element, namespace: string, name: string, value: string): ReturnType<typeof Element.prototype.setAttributeNS>; | ||
export declare function ElementRemove(el: Element): ReturnType<typeof Element.prototype.remove>; | ||
export declare function ElementRemoveAttributeNode(el: Element, attrNode: Attr): ReturnType<typeof Element.prototype.removeAttributeNode>; | ||
export declare function ElementGetNamespaceURI(el: Element): typeof Element.prototype.namespaceURI; | ||
//# sourceMappingURL=Element.d.ts.map |
export declare function HTMLElementDatasetGetter(el: HTMLElement): typeof HTMLElement.prototype.dataset; | ||
export declare function HTMLElementStyleGetter(el: HTMLElement): typeof HTMLElement.prototype.style; | ||
//# sourceMappingURL=HTMLElement.d.ts.map |
@@ -1,4 +0,2 @@ | ||
import { GlobalObject } from './types'; | ||
export declare function HTMLIFrameElementSrcSetter(iframe: HTMLIFrameElement, src: string): void; | ||
export declare function HTMLIFrameElementContentWindowGetter(iframe: HTMLIFrameElement): GlobalObject | null; | ||
//# sourceMappingURL=HTMLIFrameElement.d.ts.map |
export * from './Attr'; | ||
export * from './basic'; | ||
export * from './Blob'; | ||
export * from './clone'; | ||
export * from './Document'; | ||
@@ -5,0 +6,0 @@ export * from './DocumentFragment'; |
@@ -6,5 +6,4 @@ export declare function NodeAppendChild(node: Node, childNode: ChildNode | DocumentFragment): ReturnType<typeof Node.prototype.appendChild>; | ||
export declare function NodeIsEqualNode(node: Node, otherNode: Node): ReturnType<typeof Node.prototype.isEqualNode>; | ||
export declare function NodeLastChildGetter(node: Node): typeof Node.prototype.lastChild; | ||
export declare function NodeNameGetter(node: Node): typeof Node.prototype.nodeName; | ||
export declare function NodeOwnerDocumentGetter(node: Node): typeof Node.prototype.ownerDocument; | ||
//# sourceMappingURL=Node.d.ts.map |
import { GlobalObject } from './types'; | ||
export declare const WindowDecodeURIComponent: typeof decodeURIComponent, WindowEncodeURIComponent: typeof encodeURIComponent; | ||
export declare function getPatchedPostMessage(win: GlobalObject): WindowProxy['postMessage']; | ||
export declare function getPatchedWindow<T extends GlobalObject | null>(win: T): T; | ||
export declare function isWindow(value: any): value is GlobalObject; | ||
export declare function isWindowLike(value: any): value is typeof globalThis; | ||
export declare function WindowClearInterval(win: GlobalObject, intervalID: number): ReturnType<typeof window.clearInterval>; | ||
@@ -6,7 +11,2 @@ export declare function WindowLengthGetter(win: GlobalObject): typeof window.length; | ||
export declare function WindowSetInterval(win: GlobalObject, ...args: Parameters<typeof window.setInterval>): number; | ||
export declare function getPatchedWindow<T extends GlobalObject | null>(win: T): T; | ||
export declare function getPatchedPostMessage(originalValue: WindowProxy['postMessage'], rawWindow: GlobalObject): WindowProxy['postMessage']; | ||
export declare const WindowDecodeURIComponent: typeof decodeURIComponent, WindowEncodeURIComponent: typeof encodeURIComponent; | ||
export declare function isWindowLike(value: any): value is typeof globalThis; | ||
export declare function isWindow(value: any): value is GlobalObject; | ||
//# sourceMappingURL=Window.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
112636
59
1836
0
+ Added@locker/shared@0.15.11(transitive)
- Removed@locker/shared@0.15.10(transitive)
Updated@locker/shared@0.15.11