@locker/shared-dom
Advanced tools
Comparing version 0.15.4 to 0.15.5
@@ -21,15 +21,15 @@ /*! | ||
function AttrNameGetter$LWS(attr$LWS) { | ||
return shared$LWS.ReflectApply(AttrProtoNameGetter$LWS, attr$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(AttrProtoNameGetter$LWS, attr$LWS, []); | ||
} | ||
function AttrNamespaceURIGetter$LWS(attr$LWS) { | ||
return shared$LWS.ReflectApply(AttrProtoNamespaceURIGetter$LWS, attr$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(AttrProtoNamespaceURIGetter$LWS, attr$LWS, []); | ||
} | ||
function AttrOwnerElementGetter$LWS(attr$LWS) { | ||
return shared$LWS.ReflectApply(AttrProtoOwnerElementGetter$LWS, attr$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(AttrProtoOwnerElementGetter$LWS, attr$LWS, []); | ||
} | ||
function AttrValueGetter$LWS(attr$LWS) { | ||
return shared$LWS.ReflectApply(AttrProtoValueGetter$LWS, attr$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(AttrProtoValueGetter$LWS, attr$LWS, []); | ||
} | ||
@@ -57,7 +57,7 @@ | ||
function DocumentBodyGetter$LWS(doc$LWS) { | ||
return shared$LWS.ReflectApply(DocumentProtoBodyGetter$LWS, doc$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(DocumentProtoBodyGetter$LWS, doc$LWS, []); | ||
} | ||
function DocumentCookieGetter$LWS(doc$LWS) { | ||
return shared$LWS.ReflectApply(DocumentProtoCookieGetter$LWS, doc$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(DocumentProtoCookieGetter$LWS, doc$LWS, []); | ||
} | ||
@@ -70,3 +70,3 @@ | ||
function DocumentImplementation$LWS(doc$LWS) { | ||
return shared$LWS.ReflectApply(DocumentProtoImplementationGetter$LWS, doc$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(DocumentProtoImplementationGetter$LWS, doc$LWS, []); | ||
} | ||
@@ -87,3 +87,3 @@ | ||
function DocumentDocumentElementGetter$LWS(doc$LWS) { | ||
return shared$LWS.ReflectApply(DocumentProtoDocumentElementGetter$LWS, doc$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(DocumentProtoDocumentElementGetter$LWS, doc$LWS, []); | ||
} | ||
@@ -96,3 +96,3 @@ | ||
function DocumentHeadGetter$LWS(doc$LWS) { | ||
return shared$LWS.ReflectApply(DocumentProtoHeadGetter$LWS, doc$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(DocumentProtoHeadGetter$LWS, doc$LWS, []); | ||
} | ||
@@ -134,3 +134,3 @@ | ||
function ElementInnerHTMLGetter$LWS(el$LWS) { | ||
return shared$LWS.ReflectApply(ElementProtoInnerHTMLGetter$LWS, el$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(ElementProtoInnerHTMLGetter$LWS, el$LWS, []); | ||
} | ||
@@ -143,3 +143,3 @@ | ||
function ElementOuterHTMLGetter$LWS(el$LWS) { | ||
return shared$LWS.ReflectApply(ElementProtoOuterHTMLGetter$LWS, el$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(ElementProtoOuterHTMLGetter$LWS, el$LWS, []); | ||
} | ||
@@ -168,3 +168,3 @@ | ||
function ElementRemove$LWS(el$LWS) { | ||
return shared$LWS.ReflectApply(ElementProtoRemove$LWS, el$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(ElementProtoRemove$LWS, el$LWS, []); | ||
} | ||
@@ -177,3 +177,3 @@ | ||
function ElementGetNamespaceURI$LWS(el$LWS) { | ||
return shared$LWS.ReflectApply(ElementProtoGetNamespaceURI$LWS, el$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(ElementProtoGetNamespaceURI$LWS, el$LWS, []); | ||
} | ||
@@ -184,3 +184,3 @@ | ||
function HTMLTemplateElementContentGetter$LWS(template$LWS) { | ||
return shared$LWS.ReflectApply(HTMLTemplateElementProtoContentGetter$LWS, template$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(HTMLTemplateElementProtoContentGetter$LWS, template$LWS, []); | ||
} | ||
@@ -204,3 +204,3 @@ | ||
function NodeChildNodesGetter$LWS(node$LWS) { | ||
return shared$LWS.ReflectApply(NodeProtoChildNodesGetter$LWS, node$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(NodeProtoChildNodesGetter$LWS, node$LWS, []); | ||
} | ||
@@ -213,3 +213,3 @@ | ||
function NodeFirstChildGetter$LWS(node$LWS) { | ||
return shared$LWS.ReflectApply(NodeProtoFirstChildGetter$LWS, node$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(NodeProtoFirstChildGetter$LWS, node$LWS, []); | ||
} | ||
@@ -222,3 +222,3 @@ | ||
function NodeLastChildGetter$LWS(node$LWS) { | ||
return shared$LWS.ReflectApply(NodeProtoLastChildGetter$LWS, node$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(NodeProtoLastChildGetter$LWS, node$LWS, []); | ||
} | ||
@@ -229,7 +229,7 @@ | ||
// See https://johnresig.com/blog/nodename-case-sensitivity/. | ||
return shared$LWS.StringToUpperCase(shared$LWS.ReflectApply(NodeProtoNodeNameGetter$LWS, node$LWS, shared$LWS.emptyArray)); | ||
return shared$LWS.StringToUpperCase(shared$LWS.ReflectApply(NodeProtoNodeNameGetter$LWS, node$LWS, [])); | ||
} | ||
function NodeOwnerDocumentGetter$LWS(node$LWS) { | ||
return shared$LWS.ReflectApply(NodeProtoOwnerDocumentGetter$LWS, node$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(NodeProtoOwnerDocumentGetter$LWS, node$LWS, []); | ||
} | ||
@@ -280,5 +280,5 @@ | ||
const { | ||
document, | ||
document: document$LWS, | ||
HTMLLinkElement: HTMLLinkElement$LWS, | ||
HTMLScriptElement, | ||
HTMLScriptElement: HTMLScriptElement$LWS, | ||
MediaSource: MediaSource$LWS | ||
@@ -288,6 +288,6 @@ } = globalObject$LWS; | ||
HTMLLinkElement: HTMLLinkElement$LWS, | ||
HTMLScriptElement, | ||
HTMLScriptElement: HTMLScriptElement$LWS, | ||
MediaSource: MediaSource$LWS | ||
}; | ||
this._document = document; | ||
this._document = document$LWS; | ||
this._templates = { | ||
@@ -324,3 +324,3 @@ left: DocumentCreateElement$LWS(this._document, 'template'), | ||
function BlobSizeGetter$LWS(blob$LWS) { | ||
return shared$LWS.ReflectApply(BlobProtoSizeGetter$LWS, blob$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(BlobProtoSizeGetter$LWS, blob$LWS, []); | ||
} | ||
@@ -333,3 +333,3 @@ | ||
function BlobTypeGetter$LWS(blob$LWS) { | ||
return shared$LWS.StringToLowerCase(shared$LWS.ReflectApply(BlobProtoTypeGetter$LWS, blob$LWS, shared$LWS.emptyArray)); | ||
return shared$LWS.StringToLowerCase(shared$LWS.ReflectApply(BlobProtoTypeGetter$LWS, blob$LWS, [])); | ||
} | ||
@@ -356,3 +356,3 @@ | ||
function DOMTokenListValueGetter$LWS(tokenList$LWS) { | ||
return shared$LWS.ReflectApply(DOMTokenListProtoValueGetter$LWS, tokenList$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(DOMTokenListProtoValueGetter$LWS, tokenList$LWS, []); | ||
} | ||
@@ -363,3 +363,3 @@ | ||
function EventCurrentTargetGetter$LWS(event$LWS) { | ||
return shared$LWS.ReflectApply(EventProtoCurrentTargetGetter$LWS, event$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(EventProtoCurrentTargetGetter$LWS, event$LWS, []); | ||
} | ||
@@ -384,7 +384,7 @@ | ||
function HTMLAnchorElementHostnameGetter$LWS(anchor$LWS) { | ||
return shared$LWS.ReflectApply(HTMLAnchorElementProtoHostnameGetter$LWS, anchor$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(HTMLAnchorElementProtoHostnameGetter$LWS, anchor$LWS, []); | ||
} | ||
function HTMLAnchorElementHrefGetter$LWS(anchor$LWS) { | ||
return shared$LWS.ReflectApply(HTMLAnchorElementProtoHrefGetter$LWS, anchor$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(HTMLAnchorElementProtoHrefGetter$LWS, anchor$LWS, []); | ||
} | ||
@@ -397,7 +397,7 @@ | ||
function HTMLAnchorElementPathnameGetter$LWS(anchor$LWS) { | ||
return shared$LWS.ReflectApply(HTMLAnchorElementProtoPathnameGetter$LWS, anchor$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(HTMLAnchorElementProtoPathnameGetter$LWS, anchor$LWS, []); | ||
} | ||
function HTMLAnchorElementProtocolGetter$LWS(anchor$LWS) { | ||
return shared$LWS.ReflectApply(HTMLAnchorElementProtoProtocolGetter$LWS, anchor$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(HTMLAnchorElementProtoProtocolGetter$LWS, anchor$LWS, []); | ||
} | ||
@@ -409,7 +409,7 @@ | ||
function HTMLElementDatasetGetter$LWS(el$LWS) { | ||
return shared$LWS.ReflectApply(HTMLElementProtoDatasetGetter$LWS, el$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(HTMLElementProtoDatasetGetter$LWS, el$LWS, []); | ||
} | ||
function HTMLElementStyleGetter$LWS(el$LWS) { | ||
return shared$LWS.ReflectApply(HTMLElementProtoStyleGetter$LWS, el$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(HTMLElementProtoStyleGetter$LWS, el$LWS, []); | ||
} | ||
@@ -425,3 +425,3 @@ | ||
function HTMLIFrameElementContentWindowGetter$LWS(iframe$LWS) { | ||
return shared$LWS.ReflectApply(HTMLIFrameElementProtoContentWindowGetter$LWS, iframe$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(HTMLIFrameElementProtoContentWindowGetter$LWS, iframe$LWS, []); | ||
} | ||
@@ -445,14 +445,6 @@ | ||
function RequestURLGetter$LWS(request$LWS) { | ||
return shared$LWS.ReflectApply(RequestProtoURLGetter$LWS, request$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(RequestProtoURLGetter$LWS, request$LWS, []); | ||
} | ||
const { | ||
set: ShadowRootProtoInnerHTMLSetter$LWS | ||
} = shared$LWS.ReflectGetOwnPropertyDescriptor(ShadowRoot.prototype, 'innerHTML'); | ||
function ShadowRootInnerHTMLSetter$LWS(el$LWS, html$LWS) { | ||
shared$LWS.ReflectApply(ShadowRootProtoInnerHTMLSetter$LWS, el$LWS, [html$LWS]); | ||
} | ||
const { | ||
key: StorageProtoKey$LWS, | ||
@@ -463,29 +455,6 @@ getItem: StorageProtoGetItem$LWS, | ||
} = Storage.prototype; | ||
/** | ||
* The following detection is part of a temporary solution to handle | ||
* "Magic Object" behavior in Safari <= 14. | ||
* | ||
* Properties of HTMLElement.prototype.style, and other CSS style declaration | ||
* objects, will lose their "magic" (i.e. updating the element's style="" attribute) | ||
* if a style property is assigned by a Define Property operation. | ||
* | ||
* This marker will signal to the membrane that it must use a Set operation, | ||
* instead of a Define Property operation. | ||
* | ||
*/ | ||
const HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT$LWS = (() => { | ||
const div$LWS = document.createElement('div'); | ||
shared$LWS.ReflectDefineProperty(div$LWS.style, 'color', { | ||
// @ts-ignore: TS doesn't like __proto__ on property descriptors. | ||
__proto__: null, | ||
value: 'red' | ||
}); | ||
return div$LWS.getAttribute('style') === ''; | ||
})(); | ||
const SVGElementProtoDatasetGetter$LWS = shared$LWS.ObjectLookupOwnGetter(SVGElement.prototype, 'dataset'); | ||
function SVGElementDatasetGetter$LWS(svg$LWS) { | ||
return shared$LWS.ReflectApply(SVGElementProtoDatasetGetter$LWS, svg$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(SVGElementProtoDatasetGetter$LWS, svg$LWS, []); | ||
} | ||
@@ -499,8 +468,11 @@ | ||
const ALLOW_LIST_RAW$LWS = ['close', 'closed', 'focus']; | ||
const DEFAULT_OVERWRITTEN_VALUE$LWS = {}; | ||
const DEFAULT_OVERWRITTEN_VALUE$LWS = {}; // These properties are part of the WindowOrGlobalScope mixin and not on Window.prototype. | ||
// https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope | ||
const { | ||
clearInterval: WindowStaticClearInterval$LWS | ||
clearInterval: WindowStaticClearInterval$LWS, | ||
postMessage: WindowStaticPostMessage$LWS, | ||
setInterval: WindowStaticSetInterval$LWS | ||
} = window; | ||
const WindowStaticLengthGetter$LWS = shared$LWS.ObjectLookupOwnGetter(window, 'length'); | ||
const WindowStaticPostMessageValue$LWS = shared$LWS.ObjectLookupOwnValue(window, 'postMessage'); | ||
const WindowStaticSelfGetter$LWS = shared$LWS.ObjectLookupOwnGetter(window, 'self'); | ||
@@ -513,7 +485,7 @@ | ||
function WindowLengthGetter$LWS(win$LWS) { | ||
return shared$LWS.ReflectApply(WindowStaticLengthGetter$LWS, win$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(WindowStaticLengthGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSelfGetter$LWS(win$LWS) { | ||
return shared$LWS.ReflectApply(WindowStaticSelfGetter$LWS, win$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(WindowStaticSelfGetter$LWS, win$LWS, []); | ||
} | ||
@@ -544,3 +516,3 @@ | ||
function patchedWindowPostMessageValue$LWS(...args$LWS) { | ||
function patchedWindowPostMessage$LWS(...args$LWS) { | ||
const message$LWS = args$LWS.length ? args$LWS[0] : undefined; | ||
@@ -557,3 +529,3 @@ | ||
return shared$LWS.ReflectApply(WindowStaticPostMessageValue$LWS, this, args$LWS); | ||
return shared$LWS.ReflectApply(WindowStaticPostMessage$LWS, this, args$LWS); | ||
} // istanbul ignore next | ||
@@ -565,3 +537,5 @@ | ||
for (let i$LWS = 0, len$LWS = ALLOW_LIST_RAW$LWS.length; i$LWS < len$LWS; i$LWS += 1) { | ||
for (let i$LWS = 0, { | ||
length: length$LWS | ||
} = ALLOW_LIST_RAW$LWS; i$LWS < length$LWS; i$LWS += 1) { | ||
const key$LWS = ALLOW_LIST_RAW$LWS[i$LWS]; | ||
@@ -594,3 +568,3 @@ const unsafeDesc$LWS = shared$LWS.ReflectGetOwnPropertyDescriptor(rawWindow$LWS, key$LWS); | ||
safeDesc$LWS.get = function get$LWS() { | ||
return overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS ? shared$LWS.ReflectApply(getter$LWS, rawWindow$LWS, shared$LWS.emptyArray) : overwrittenValue$LWS; | ||
return overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS ? shared$LWS.ReflectApply(getter$LWS, rawWindow$LWS, []) : overwrittenValue$LWS; | ||
}; | ||
@@ -610,3 +584,5 @@ } | ||
for (let i$LWS = 0, len$LWS = ALLOW_LIST_PATCHED$LWS.length; i$LWS < len$LWS; i$LWS += 1) { | ||
for (let i$LWS = 0, { | ||
length: length$LWS | ||
} = ALLOW_LIST_PATCHED$LWS; i$LWS < length$LWS; i$LWS += 1) { | ||
const key$LWS = ALLOW_LIST_PATCHED$LWS[i$LWS]; | ||
@@ -626,3 +602,3 @@ const unsafeDesc$LWS = shared$LWS.ReflectGetOwnPropertyDescriptor(rawWindow$LWS, key$LWS); | ||
if (overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS) { | ||
return getPatchedWindow$LWS(shared$LWS.ReflectApply(getter$LWS, rawWindow$LWS, shared$LWS.emptyArray)); | ||
return getPatchedWindow$LWS(shared$LWS.ReflectApply(getter$LWS, rawWindow$LWS, [])); | ||
} | ||
@@ -654,3 +630,3 @@ | ||
safeDesc$LWS.value = function postMessage$LWS(...args$LWS) { | ||
return shared$LWS.ReflectApply(patchedWindowPostMessageValue$LWS, rawWindow$LWS, args$LWS); | ||
return shared$LWS.ReflectApply(patchedWindowPostMessage$LWS, rawWindow$LWS, args$LWS); | ||
}; | ||
@@ -663,10 +639,7 @@ } | ||
return patchedWindow$LWS; | ||
} // setInterval and clearInterval are part of WindowOrGlobalScope mixin, they are | ||
// not on Window.prototype. See https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope. | ||
} | ||
const { | ||
decodeURIComponent: WindowStaticDecodeURIComponent$LWS, | ||
encodeURIComponent: WindowStaticEncodeURIComponent$LWS, | ||
setInterval: WindowStaticSetInterval$LWS | ||
decodeURIComponent: WindowDecodeURIComponent$LWS, | ||
encodeURIComponent: WindowEncodeURIComponent$LWS | ||
} = window; | ||
@@ -720,3 +693,3 @@ | ||
function XhrResponseTextGetter$LWS(xhr$LWS) { | ||
return shared$LWS.ReflectApply(XhrProtoResponseTextGetter$LWS, xhr$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(XhrProtoResponseTextGetter$LWS, xhr$LWS, []); | ||
} // istanbul ignore next | ||
@@ -726,3 +699,3 @@ | ||
function XhrSend$LWS(xhr$LWS) { | ||
return shared$LWS.ReflectApply(XhrProtoSend$LWS, xhr$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(XhrProtoSend$LWS, xhr$LWS, []); | ||
} // istanbul ignore next | ||
@@ -732,3 +705,3 @@ | ||
function XhrStatusGetter$LWS(xhr$LWS) { | ||
return shared$LWS.ReflectApply(XhrProtoStatusGetter$LWS, xhr$LWS, shared$LWS.emptyArray); | ||
return shared$LWS.ReflectApply(XhrProtoStatusGetter$LWS, xhr$LWS, []); | ||
} // istanbul ignore next | ||
@@ -779,3 +752,2 @@ | ||
exports.EventTargetAddEventListener = EventTargetAddEventListener$LWS; | ||
exports.HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT = HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT$LWS; | ||
exports.HTMLAnchorElementHostnameGetter = HTMLAnchorElementHostnameGetter$LWS; | ||
@@ -809,3 +781,2 @@ exports.HTMLAnchorElementHrefGetter = HTMLAnchorElementHrefGetter$LWS; | ||
exports.SVGElementDatasetGetter = SVGElementDatasetGetter$LWS; | ||
exports.ShadowRootInnerHTMLSetter = ShadowRootInnerHTMLSetter$LWS; | ||
exports.StorageProtoGetItem = StorageProtoGetItem$LWS; | ||
@@ -818,8 +789,7 @@ exports.StorageProtoKey = StorageProtoKey$LWS; | ||
exports.WindowClearInterval = WindowClearInterval$LWS; | ||
exports.WindowDecodeURIComponent = WindowDecodeURIComponent$LWS; | ||
exports.WindowEncodeURIComponent = WindowEncodeURIComponent$LWS; | ||
exports.WindowLengthGetter = WindowLengthGetter$LWS; | ||
exports.WindowSelfGetter = WindowSelfGetter$LWS; | ||
exports.WindowSetInterval = WindowSetInterval$LWS; | ||
exports.WindowStaticDecodeURIComponent = WindowStaticDecodeURIComponent$LWS; | ||
exports.WindowStaticEncodeURIComponent = WindowStaticEncodeURIComponent$LWS; | ||
exports.WindowStaticSetInterval = WindowStaticSetInterval$LWS; | ||
exports.XhrCtor = XhrCtor$LWS; | ||
@@ -837,3 +807,3 @@ exports.XhrOpen = XhrOpen$LWS; | ||
exports.nsCookieRootKey = nsCookieRootKey$LWS; | ||
exports.patchedWindowPostMessageValue = patchedWindowPostMessageValue$LWS; | ||
/*! version: 0.15.4 */ | ||
exports.patchedWindowPostMessage = patchedWindowPostMessage$LWS; | ||
/*! version: 0.15.5 */ |
/*! | ||
* Copyright (C) 2019 salesforce.com, inc. | ||
*/ | ||
import { ObjectLookupOwnGetter, ReflectGetOwnPropertyDescriptor, ReflectApply, emptyArray, StringToUpperCase, WeakMapCtor, WeakMapGet, WeakMapSet, JSONParse, JSONStringify, StringToLowerCase, ObjectLookupOwnSetter, ReflectDefineProperty, ObjectLookupOwnValue, isObject, toSafeDescriptor, FunctionBind, ObjectHasOwnProperty } from '@locker/shared'; | ||
const AttrProtoNameGetter$LWS = ObjectLookupOwnGetter(Attr.prototype, 'name'); | ||
const AttrProtoNamespaceURIGetter$LWS = ObjectLookupOwnGetter(Attr.prototype, 'namespaceURI'); | ||
const AttrProtoOwnerElementGetter$LWS = ObjectLookupOwnGetter(Attr.prototype, 'ownerElement'); | ||
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, StringToLowerCase as StringToLowerCase$LWS, ObjectLookupOwnSetter as ObjectLookupOwnSetter$LWS, isObject as isObject$LWS, toSafeDescriptor as toSafeDescriptor$LWS, FunctionBind as FunctionBind$LWS, ReflectDefineProperty as ReflectDefineProperty$LWS, ObjectHasOwnProperty as ObjectHasOwnProperty$LWS } from '@locker/shared'; | ||
const AttrProtoNameGetter$LWS = ObjectLookupOwnGetter$LWS(Attr.prototype, 'name'); | ||
const AttrProtoNamespaceURIGetter$LWS = ObjectLookupOwnGetter$LWS(Attr.prototype, 'namespaceURI'); | ||
const AttrProtoOwnerElementGetter$LWS = ObjectLookupOwnGetter$LWS(Attr.prototype, 'ownerElement'); | ||
const { | ||
get: AttrProtoValueGetter$LWS, | ||
set: AttrProtoValueSetter$LWS | ||
} = ReflectGetOwnPropertyDescriptor(Attr.prototype, 'value'); | ||
} = ReflectGetOwnPropertyDescriptor$LWS(Attr.prototype, 'value'); | ||
function AttrNameGetter(attr$LWS) { | ||
return ReflectApply(AttrProtoNameGetter$LWS, attr$LWS, emptyArray); | ||
function AttrNameGetter$LWS(attr$LWS) { | ||
return ReflectApply$LWS(AttrProtoNameGetter$LWS, attr$LWS, []); | ||
} | ||
function AttrNamespaceURIGetter(attr$LWS) { | ||
return ReflectApply(AttrProtoNamespaceURIGetter$LWS, attr$LWS, emptyArray); | ||
function AttrNamespaceURIGetter$LWS(attr$LWS) { | ||
return ReflectApply$LWS(AttrProtoNamespaceURIGetter$LWS, attr$LWS, []); | ||
} | ||
function AttrOwnerElementGetter(attr$LWS) { | ||
return ReflectApply(AttrProtoOwnerElementGetter$LWS, attr$LWS, emptyArray); | ||
function AttrOwnerElementGetter$LWS(attr$LWS) { | ||
return ReflectApply$LWS(AttrProtoOwnerElementGetter$LWS, attr$LWS, []); | ||
} | ||
function AttrValueGetter(attr$LWS) { | ||
return ReflectApply(AttrProtoValueGetter$LWS, attr$LWS, emptyArray); | ||
function AttrValueGetter$LWS(attr$LWS) { | ||
return ReflectApply$LWS(AttrProtoValueGetter$LWS, attr$LWS, []); | ||
} | ||
function AttrValueSetter(attr$LWS, value$LWS) { | ||
ReflectApply(AttrProtoValueSetter$LWS, attr$LWS, [value$LWS]); | ||
function AttrValueSetter$LWS(attr$LWS, value$LWS) { | ||
ReflectApply$LWS(AttrProtoValueSetter$LWS, attr$LWS, [value$LWS]); | ||
} | ||
@@ -36,3 +36,3 @@ | ||
set: DocumentProtoCookieSetter$LWS | ||
} = ReflectGetOwnPropertyDescriptor(Document.prototype, 'cookie'); | ||
} = ReflectGetOwnPropertyDescriptor$LWS(Document.prototype, 'cookie'); | ||
const { | ||
@@ -44,58 +44,58 @@ createComment: DocumentProtoCreateComment$LWS, | ||
} = Document.prototype; | ||
const DocumentProtoBodyGetter$LWS = ObjectLookupOwnGetter(Document.prototype, 'body'); | ||
const DocumentProtoDocumentElementGetter$LWS = ObjectLookupOwnGetter(Document.prototype, 'documentElement'); | ||
const DocumentProtoHeadGetter$LWS = ObjectLookupOwnGetter(Document.prototype, 'head'); | ||
const DocumentProtoImplementationGetter$LWS = ObjectLookupOwnGetter(Document.prototype, 'implementation'); | ||
const DocumentProtoBodyGetter$LWS = ObjectLookupOwnGetter$LWS(Document.prototype, 'body'); | ||
const DocumentProtoDocumentElementGetter$LWS = ObjectLookupOwnGetter$LWS(Document.prototype, 'documentElement'); | ||
const DocumentProtoHeadGetter$LWS = ObjectLookupOwnGetter$LWS(Document.prototype, 'head'); | ||
const DocumentProtoImplementationGetter$LWS = ObjectLookupOwnGetter$LWS(Document.prototype, 'implementation'); | ||
function DocumentBodyGetter(doc$LWS) { | ||
return ReflectApply(DocumentProtoBodyGetter$LWS, doc$LWS, emptyArray); | ||
function DocumentBodyGetter$LWS(doc$LWS) { | ||
return ReflectApply$LWS(DocumentProtoBodyGetter$LWS, doc$LWS, []); | ||
} | ||
function DocumentCookieGetter(doc$LWS) { | ||
return ReflectApply(DocumentProtoCookieGetter$LWS, doc$LWS, emptyArray); | ||
function DocumentCookieGetter$LWS(doc$LWS) { | ||
return ReflectApply$LWS(DocumentProtoCookieGetter$LWS, doc$LWS, []); | ||
} | ||
function DocumentCookieSetter(doc$LWS, newCookie$LWS) { | ||
ReflectApply(DocumentProtoCookieSetter$LWS, doc$LWS, [newCookie$LWS]); | ||
function DocumentCookieSetter$LWS(doc$LWS, newCookie$LWS) { | ||
ReflectApply$LWS(DocumentProtoCookieSetter$LWS, doc$LWS, [newCookie$LWS]); | ||
} | ||
function DocumentImplementation(doc$LWS) { | ||
return ReflectApply(DocumentProtoImplementationGetter$LWS, doc$LWS, emptyArray); | ||
function DocumentImplementation$LWS(doc$LWS) { | ||
return ReflectApply$LWS(DocumentProtoImplementationGetter$LWS, doc$LWS, []); | ||
} | ||
function DocumentCreateComment(doc$LWS, data$LWS = '') { | ||
return ReflectApply(DocumentProtoCreateComment$LWS, doc$LWS, [data$LWS]); | ||
function DocumentCreateComment$LWS(doc$LWS, data$LWS = '') { | ||
return ReflectApply$LWS(DocumentProtoCreateComment$LWS, doc$LWS, [data$LWS]); | ||
} | ||
function DocumentCreateElement(doc$LWS, ...args$LWS) { | ||
return ReflectApply(DocumentProtoCreateElement$LWS, doc$LWS, args$LWS); | ||
function DocumentCreateElement$LWS(doc$LWS, ...args$LWS) { | ||
return ReflectApply$LWS(DocumentProtoCreateElement$LWS, doc$LWS, args$LWS); | ||
} | ||
function DocumentCreateElementNS(doc$LWS, ...args$LWS) { | ||
return ReflectApply(DocumentProtoCreateElementNS$LWS, doc$LWS, args$LWS); | ||
function DocumentCreateElementNS$LWS(doc$LWS, ...args$LWS) { | ||
return ReflectApply$LWS(DocumentProtoCreateElementNS$LWS, doc$LWS, args$LWS); | ||
} | ||
function DocumentDocumentElementGetter(doc$LWS) { | ||
return ReflectApply(DocumentProtoDocumentElementGetter$LWS, doc$LWS, emptyArray); | ||
function DocumentDocumentElementGetter$LWS(doc$LWS) { | ||
return ReflectApply$LWS(DocumentProtoDocumentElementGetter$LWS, doc$LWS, []); | ||
} | ||
function DocumentGetElementById(doc$LWS, id$LWS) { | ||
return ReflectApply(DocumentProtoGetElementById$LWS, doc$LWS, [id$LWS]); | ||
function DocumentGetElementById$LWS(doc$LWS, id$LWS) { | ||
return ReflectApply$LWS(DocumentProtoGetElementById$LWS, doc$LWS, [id$LWS]); | ||
} | ||
function DocumentHeadGetter(doc$LWS) { | ||
return ReflectApply(DocumentProtoHeadGetter$LWS, doc$LWS, emptyArray); | ||
function DocumentHeadGetter$LWS(doc$LWS) { | ||
return ReflectApply$LWS(DocumentProtoHeadGetter$LWS, doc$LWS, []); | ||
} | ||
function nsCookieRootKey(ns$LWS) { | ||
function nsCookieRootKey$LWS(ns$LWS) { | ||
return `LSKey-${ns$LWS}$`; | ||
} | ||
function nsCookieKey(key$LWS, ns$LWS) { | ||
return `${nsCookieRootKey(ns$LWS)}${key$LWS}`; | ||
function nsCookieKey$LWS(key$LWS, ns$LWS) { | ||
return `${nsCookieRootKey$LWS(ns$LWS)}${key$LWS}`; | ||
} | ||
const { | ||
setAttribute: ElementProtoSetAttribute, | ||
setAttributeNS: ElementProtoSetAttributeNS | ||
setAttribute: ElementProtoSetAttribute$LWS, | ||
setAttributeNS: ElementProtoSetAttributeNS$LWS | ||
} = Element.prototype; | ||
@@ -113,60 +113,60 @@ const { | ||
set: ElementProtoInnerHTMLSetter$LWS | ||
} = ReflectGetOwnPropertyDescriptor(Element.prototype, 'innerHTML'); | ||
} = ReflectGetOwnPropertyDescriptor$LWS(Element.prototype, 'innerHTML'); | ||
const { | ||
get: ElementProtoOuterHTMLGetter$LWS | ||
} = ReflectGetOwnPropertyDescriptor(Element.prototype, 'outerHTML'); | ||
const ElementProtoGetNamespaceURI$LWS = ObjectLookupOwnGetter(Element.prototype, 'namespaceURI'); | ||
} = ReflectGetOwnPropertyDescriptor$LWS(Element.prototype, 'outerHTML'); | ||
const ElementProtoGetNamespaceURI$LWS = ObjectLookupOwnGetter$LWS(Element.prototype, 'namespaceURI'); | ||
function ElementClosest(el$LWS, selectors$LWS) { | ||
return ReflectApply(ElementProtoClosest$LWS, el$LWS, [selectors$LWS]); | ||
function ElementClosest$LWS(el$LWS, selectors$LWS) { | ||
return ReflectApply$LWS(ElementProtoClosest$LWS, el$LWS, [selectors$LWS]); | ||
} | ||
function ElementInnerHTMLGetter(el$LWS) { | ||
return ReflectApply(ElementProtoInnerHTMLGetter$LWS, el$LWS, emptyArray); | ||
function ElementInnerHTMLGetter$LWS(el$LWS) { | ||
return ReflectApply$LWS(ElementProtoInnerHTMLGetter$LWS, el$LWS, []); | ||
} | ||
function ElementInnerHTMLSetter(el$LWS, html$LWS) { | ||
ReflectApply(ElementProtoInnerHTMLSetter$LWS, el$LWS, [html$LWS]); | ||
function ElementInnerHTMLSetter$LWS(el$LWS, html$LWS) { | ||
ReflectApply$LWS(ElementProtoInnerHTMLSetter$LWS, el$LWS, [html$LWS]); | ||
} | ||
function ElementOuterHTMLGetter(el$LWS) { | ||
return ReflectApply(ElementProtoOuterHTMLGetter$LWS, el$LWS, emptyArray); | ||
function ElementOuterHTMLGetter$LWS(el$LWS) { | ||
return ReflectApply$LWS(ElementProtoOuterHTMLGetter$LWS, el$LWS, []); | ||
} | ||
function ElementQuerySelector(el$LWS, selectors$LWS) { | ||
return ReflectApply(ElementProtoQuerySelector$LWS, el$LWS, [selectors$LWS]); | ||
function ElementQuerySelector$LWS(el$LWS, selectors$LWS) { | ||
return ReflectApply$LWS(ElementProtoQuerySelector$LWS, el$LWS, [selectors$LWS]); | ||
} | ||
function ElementGetAttributeNode(el$LWS, attrName$LWS) { | ||
return ReflectApply(ElementProtoGetAttributeNode$LWS, el$LWS, [attrName$LWS]); | ||
function ElementGetAttributeNode$LWS(el$LWS, attrName$LWS) { | ||
return ReflectApply$LWS(ElementProtoGetAttributeNode$LWS, el$LWS, [attrName$LWS]); | ||
} | ||
function ElementGetAttributeNodeNS(el$LWS, namespace$LWS, nodeName$LWS) { | ||
return ReflectApply(ElementProtoGetAttributeNodeNS$LWS, el$LWS, [namespace$LWS, nodeName$LWS]); | ||
function ElementGetAttributeNodeNS$LWS(el$LWS, namespace$LWS, nodeName$LWS) { | ||
return ReflectApply$LWS(ElementProtoGetAttributeNodeNS$LWS, el$LWS, [namespace$LWS, nodeName$LWS]); | ||
} | ||
function ElementSetAttribute(el$LWS, name$LWS, value$LWS) { | ||
return ReflectApply(ElementProtoSetAttribute, el$LWS, [name$LWS, value$LWS]); | ||
function ElementSetAttribute$LWS(el$LWS, name$LWS, value$LWS) { | ||
return ReflectApply$LWS(ElementProtoSetAttribute$LWS, el$LWS, [name$LWS, value$LWS]); | ||
} | ||
function ElementSetAttributeNS(el$LWS, namespace$LWS, name$LWS, value$LWS) { | ||
return ReflectApply(ElementProtoSetAttributeNS, el$LWS, [namespace$LWS, name$LWS, value$LWS]); | ||
function ElementSetAttributeNS$LWS(el$LWS, namespace$LWS, name$LWS, value$LWS) { | ||
return ReflectApply$LWS(ElementProtoSetAttributeNS$LWS, el$LWS, [namespace$LWS, name$LWS, value$LWS]); | ||
} | ||
function ElementRemove(el$LWS) { | ||
return ReflectApply(ElementProtoRemove$LWS, el$LWS, emptyArray); | ||
function ElementRemove$LWS(el$LWS) { | ||
return ReflectApply$LWS(ElementProtoRemove$LWS, el$LWS, []); | ||
} | ||
function ElementRemoveAttributeNode(el$LWS, attrNode$LWS) { | ||
return ReflectApply(ElementProtoRemoveAttributeNode$LWS, el$LWS, [attrNode$LWS]); | ||
function ElementRemoveAttributeNode$LWS(el$LWS, attrNode$LWS) { | ||
return ReflectApply$LWS(ElementProtoRemoveAttributeNode$LWS, el$LWS, [attrNode$LWS]); | ||
} | ||
function ElementGetNamespaceURI(el$LWS) { | ||
return ReflectApply(ElementProtoGetNamespaceURI$LWS, el$LWS, emptyArray); | ||
function ElementGetNamespaceURI$LWS(el$LWS) { | ||
return ReflectApply$LWS(ElementProtoGetNamespaceURI$LWS, el$LWS, []); | ||
} | ||
const HTMLTemplateElementProtoContentGetter$LWS = ObjectLookupOwnGetter(HTMLTemplateElement.prototype, 'content'); | ||
const HTMLTemplateElementProtoContentGetter$LWS = ObjectLookupOwnGetter$LWS(HTMLTemplateElement.prototype, 'content'); | ||
function HTMLTemplateElementContentGetter(template$LWS) { | ||
return ReflectApply(HTMLTemplateElementProtoContentGetter$LWS, template$LWS, emptyArray); | ||
function HTMLTemplateElementContentGetter$LWS(template$LWS) { | ||
return ReflectApply$LWS(HTMLTemplateElementProtoContentGetter$LWS, template$LWS, []); | ||
} | ||
@@ -179,52 +179,52 @@ | ||
} = Node.prototype; | ||
const NodeProtoChildNodesGetter$LWS = ObjectLookupOwnGetter(Node.prototype, 'childNodes'); | ||
const NodeProtoFirstChildGetter$LWS = ObjectLookupOwnGetter(Node.prototype, 'firstChild'); | ||
const NodeProtoLastChildGetter$LWS = ObjectLookupOwnGetter(Node.prototype, 'lastChild'); | ||
const NodeProtoNodeNameGetter$LWS = ObjectLookupOwnGetter(Node.prototype, 'nodeName'); | ||
const NodeProtoOwnerDocumentGetter$LWS = ObjectLookupOwnGetter(Node.prototype, 'ownerDocument'); | ||
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'); | ||
function NodeAppendChild(node$LWS, childNode$LWS) { | ||
return ReflectApply(NodeProtoAppendChild$LWS, node$LWS, [childNode$LWS]); | ||
function NodeAppendChild$LWS(node$LWS, childNode$LWS) { | ||
return ReflectApply$LWS(NodeProtoAppendChild$LWS, node$LWS, [childNode$LWS]); | ||
} | ||
function NodeChildNodesGetter(node$LWS) { | ||
return ReflectApply(NodeProtoChildNodesGetter$LWS, node$LWS, emptyArray); | ||
function NodeChildNodesGetter$LWS(node$LWS) { | ||
return ReflectApply$LWS(NodeProtoChildNodesGetter$LWS, node$LWS, []); | ||
} | ||
function NodeClone(node$LWS, deep$LWS = false) { | ||
return ReflectApply(NodeProtoCloneNode$LWS, node$LWS, [deep$LWS]); | ||
function NodeClone$LWS(node$LWS, deep$LWS = false) { | ||
return ReflectApply$LWS(NodeProtoCloneNode$LWS, node$LWS, [deep$LWS]); | ||
} | ||
function NodeFirstChildGetter(node$LWS) { | ||
return ReflectApply(NodeProtoFirstChildGetter$LWS, node$LWS, emptyArray); | ||
function NodeFirstChildGetter$LWS(node$LWS) { | ||
return ReflectApply$LWS(NodeProtoFirstChildGetter$LWS, node$LWS, []); | ||
} | ||
function NodeIsEqualNode(node$LWS, otherNode$LWS) { | ||
return ReflectApply(NodeProtoIsEqualNode$LWS, node$LWS, [otherNode$LWS]); | ||
function NodeIsEqualNode$LWS(node$LWS, otherNode$LWS) { | ||
return ReflectApply$LWS(NodeProtoIsEqualNode$LWS, node$LWS, [otherNode$LWS]); | ||
} | ||
function NodeLastChildGetter(node$LWS) { | ||
return ReflectApply(NodeProtoLastChildGetter$LWS, node$LWS, emptyArray); | ||
function NodeLastChildGetter$LWS(node$LWS) { | ||
return ReflectApply$LWS(NodeProtoLastChildGetter$LWS, node$LWS, []); | ||
} | ||
function NodeNameGetter(node$LWS) { | ||
function NodeNameGetter$LWS(node$LWS) { | ||
// Normalize nodeName to upper case. | ||
// See https://johnresig.com/blog/nodename-case-sensitivity/. | ||
return StringToUpperCase(ReflectApply(NodeProtoNodeNameGetter$LWS, node$LWS, emptyArray)); | ||
return StringToUpperCase$LWS(ReflectApply$LWS(NodeProtoNodeNameGetter$LWS, node$LWS, [])); | ||
} | ||
function NodeOwnerDocumentGetter(node$LWS) { | ||
return ReflectApply(NodeProtoOwnerDocumentGetter$LWS, node$LWS, emptyArray); | ||
function NodeOwnerDocumentGetter$LWS(node$LWS) { | ||
return ReflectApply$LWS(NodeProtoOwnerDocumentGetter$LWS, node$LWS, []); | ||
} | ||
function deepIsEqualNode$LWS(leftRoot$LWS, rightRoot$LWS) { | ||
const leftRootNode$LWS = leftRoot$LWS instanceof HTMLTemplateElement ? HTMLTemplateElementContentGetter(leftRoot$LWS) : leftRoot$LWS; | ||
const rightRootNode$LWS = rightRoot$LWS instanceof HTMLTemplateElement ? HTMLTemplateElementContentGetter(rightRoot$LWS) : rightRoot$LWS; | ||
const leftRootNode$LWS = leftRoot$LWS instanceof HTMLTemplateElement ? HTMLTemplateElementContentGetter$LWS(leftRoot$LWS) : leftRoot$LWS; | ||
const rightRootNode$LWS = rightRoot$LWS instanceof HTMLTemplateElement ? HTMLTemplateElementContentGetter$LWS(rightRoot$LWS) : rightRoot$LWS; | ||
if (NodeIsEqualNode(leftRootNode$LWS, rightRootNode$LWS)) { | ||
const leftChildNodes$LWS = NodeChildNodesGetter(leftRootNode$LWS); | ||
if (NodeIsEqualNode$LWS(leftRootNode$LWS, rightRootNode$LWS)) { | ||
const leftChildNodes$LWS = NodeChildNodesGetter$LWS(leftRootNode$LWS); | ||
const childCount$LWS = leftChildNodes$LWS.length; | ||
if (childCount$LWS > 0) { | ||
const rightChildNodes$LWS = NodeChildNodesGetter(rightRootNode$LWS); | ||
const rightChildNodes$LWS = NodeChildNodesGetter$LWS(rightRootNode$LWS); | ||
@@ -244,3 +244,3 @@ for (let i$LWS = 0; i$LWS < childCount$LWS; i$LWS += 1) { | ||
const globalObjectToValidatorMap$LWS = new WeakMapCtor(); | ||
const globalObjectToValidatorMap$LWS = new WeakMapCtor$LWS(); | ||
/* eslint no-underscore-dangle: ['error',{allowAfterThis:true}] */ | ||
@@ -251,8 +251,8 @@ | ||
this.isEqualDomString = (leftString$LWS, rightString$LWS) => { | ||
ElementInnerHTMLSetter(this._templates.left, leftString$LWS); | ||
ElementInnerHTMLSetter(this._templates.right, rightString$LWS); | ||
ElementInnerHTMLSetter$LWS(this._templates.left, leftString$LWS); | ||
ElementInnerHTMLSetter$LWS(this._templates.right, rightString$LWS); | ||
return deepIsEqualNode$LWS(this._templates.left, this._templates.right); | ||
}; | ||
this.isSharedElement = element$LWS => element$LWS === DocumentHeadGetter(this._document) || element$LWS === DocumentBodyGetter(this._document) || element$LWS === DocumentDocumentElementGetter(this._document); | ||
this.isSharedElement = element$LWS => element$LWS === DocumentHeadGetter$LWS(this._document) || element$LWS === DocumentBodyGetter$LWS(this._document) || element$LWS === DocumentDocumentElementGetter$LWS(this._document); | ||
@@ -265,5 +265,5 @@ this.isSharedElementChild = element$LWS => element$LWS instanceof this._constructors.HTMLLinkElement || element$LWS instanceof this._constructors.HTMLScriptElement; | ||
const { | ||
document, | ||
document: document$LWS, | ||
HTMLLinkElement: HTMLLinkElement$LWS, | ||
HTMLScriptElement, | ||
HTMLScriptElement: HTMLScriptElement$LWS, | ||
MediaSource: MediaSource$LWS | ||
@@ -273,9 +273,9 @@ } = globalObject$LWS; | ||
HTMLLinkElement: HTMLLinkElement$LWS, | ||
HTMLScriptElement, | ||
HTMLScriptElement: HTMLScriptElement$LWS, | ||
MediaSource: MediaSource$LWS | ||
}; | ||
this._document = document; | ||
this._document = document$LWS; | ||
this._templates = { | ||
left: DocumentCreateElement(this._document, 'template'), | ||
right: DocumentCreateElement(this._document, 'template') | ||
left: DocumentCreateElement$LWS(this._document, 'template'), | ||
right: DocumentCreateElement$LWS(this._document, 'template') | ||
}; | ||
@@ -286,8 +286,8 @@ } | ||
function getValidator(globalObject$LWS) { | ||
let validator$LWS = WeakMapGet(globalObjectToValidatorMap$LWS, globalObject$LWS); | ||
function getValidator$LWS(globalObject$LWS) { | ||
let validator$LWS = WeakMapGet$LWS(globalObjectToValidatorMap$LWS, globalObject$LWS); | ||
if (!validator$LWS) { | ||
validator$LWS = new Validator$LWS(globalObject$LWS); | ||
WeakMapSet(globalObjectToValidatorMap$LWS, globalObject$LWS, validator$LWS); | ||
WeakMapSet$LWS(globalObjectToValidatorMap$LWS, globalObject$LWS, validator$LWS); | ||
} | ||
@@ -298,23 +298,23 @@ | ||
function JSONClone(value$LWS) { | ||
return JSONParse(JSONStringify(value$LWS)); | ||
function JSONClone$LWS(value$LWS) { | ||
return JSONParse$LWS(JSONStringify$LWS(value$LWS)); | ||
} | ||
const BlobProtoSizeGetter$LWS = ObjectLookupOwnGetter(Blob.prototype, 'size'); | ||
const BlobProtoSizeGetter$LWS = ObjectLookupOwnGetter$LWS(Blob.prototype, 'size'); | ||
const { | ||
slice: BlobProtoSlice$LWS | ||
} = Blob.prototype; | ||
const BlobProtoTypeGetter$LWS = ObjectLookupOwnGetter(Blob.prototype, 'type'); | ||
const BlobCtor = Blob; | ||
const BlobProtoTypeGetter$LWS = ObjectLookupOwnGetter$LWS(Blob.prototype, 'type'); | ||
const BlobCtor$LWS = Blob; | ||
function BlobSizeGetter(blob$LWS) { | ||
return ReflectApply(BlobProtoSizeGetter$LWS, blob$LWS, emptyArray); | ||
function BlobSizeGetter$LWS(blob$LWS) { | ||
return ReflectApply$LWS(BlobProtoSizeGetter$LWS, blob$LWS, []); | ||
} | ||
function BlobSlice(blob$LWS, ...args$LWS) { | ||
return ReflectApply(BlobProtoSlice$LWS, blob$LWS, args$LWS); | ||
function BlobSlice$LWS(blob$LWS, ...args$LWS) { | ||
return ReflectApply$LWS(BlobProtoSlice$LWS, blob$LWS, args$LWS); | ||
} | ||
function BlobTypeGetter(blob$LWS) { | ||
return StringToLowerCase(ReflectApply(BlobProtoTypeGetter$LWS, blob$LWS, emptyArray)); | ||
function BlobTypeGetter$LWS(blob$LWS) { | ||
return StringToLowerCase$LWS(ReflectApply$LWS(BlobProtoTypeGetter$LWS, blob$LWS, [])); | ||
} | ||
@@ -326,4 +326,4 @@ | ||
function DocumentFragmentGetElementById(fragment$LWS, id$LWS) { | ||
return ReflectApply(DocumentFragmentProtoGetElementById$LWS, fragment$LWS, [id$LWS]); | ||
function DocumentFragmentGetElementById$LWS(fragment$LWS, id$LWS) { | ||
return ReflectApply$LWS(DocumentFragmentProtoGetElementById$LWS, fragment$LWS, [id$LWS]); | ||
} | ||
@@ -335,16 +335,16 @@ | ||
function DOMImplementationCreateDocument(domImplementation$LWS, ...args$LWS) { | ||
return ReflectApply(DOMImplementationProtoCreateDocument$LWS, domImplementation$LWS, args$LWS); | ||
function DOMImplementationCreateDocument$LWS(domImplementation$LWS, ...args$LWS) { | ||
return ReflectApply$LWS(DOMImplementationProtoCreateDocument$LWS, domImplementation$LWS, args$LWS); | ||
} | ||
const DOMTokenListProtoValueGetter$LWS = ObjectLookupOwnGetter(DOMTokenList.prototype, 'value'); | ||
const DOMTokenListProtoValueGetter$LWS = ObjectLookupOwnGetter$LWS(DOMTokenList.prototype, 'value'); | ||
function DOMTokenListValueGetter(tokenList$LWS) { | ||
return ReflectApply(DOMTokenListProtoValueGetter$LWS, tokenList$LWS, emptyArray); | ||
function DOMTokenListValueGetter$LWS(tokenList$LWS) { | ||
return ReflectApply$LWS(DOMTokenListProtoValueGetter$LWS, tokenList$LWS, []); | ||
} | ||
const EventProtoCurrentTargetGetter$LWS = ObjectLookupOwnGetter(Event.prototype, 'currentTarget'); | ||
const EventProtoCurrentTargetGetter$LWS = ObjectLookupOwnGetter$LWS(Event.prototype, 'currentTarget'); | ||
function EventCurrentTargetGetter(event$LWS) { | ||
return ReflectApply(EventProtoCurrentTargetGetter$LWS, event$LWS, emptyArray); | ||
function EventCurrentTargetGetter$LWS(event$LWS) { | ||
return ReflectApply$LWS(EventProtoCurrentTargetGetter$LWS, event$LWS, []); | ||
} | ||
@@ -356,159 +356,131 @@ | ||
function EventTargetAddEventListener(target$LWS, ...args$LWS) { | ||
return ReflectApply(EventTargetProtoAddEventListener$LWS, target$LWS, args$LWS); | ||
function EventTargetAddEventListener$LWS(target$LWS, ...args$LWS) { | ||
return ReflectApply$LWS(EventTargetProtoAddEventListener$LWS, target$LWS, args$LWS); | ||
} | ||
const HTMLAnchorElementProtoHostnameGetter$LWS = ObjectLookupOwnGetter(HTMLAnchorElement.prototype, 'hostname'); | ||
const HTMLAnchorElementProtoHostnameGetter$LWS = ObjectLookupOwnGetter$LWS(HTMLAnchorElement.prototype, 'hostname'); | ||
const { | ||
get: HTMLAnchorElementProtoHrefGetter$LWS, | ||
set: HTMLAnchorElementProtoHrefSetter$LWS | ||
} = ReflectGetOwnPropertyDescriptor(HTMLAnchorElement.prototype, 'href'); | ||
const HTMLAnchorElementProtoPathnameGetter$LWS = ObjectLookupOwnGetter(HTMLAnchorElement.prototype, 'pathname'); | ||
const HTMLAnchorElementProtoProtocolGetter$LWS = ObjectLookupOwnGetter(HTMLAnchorElement.prototype, 'protocol'); | ||
} = ReflectGetOwnPropertyDescriptor$LWS(HTMLAnchorElement.prototype, 'href'); | ||
const HTMLAnchorElementProtoPathnameGetter$LWS = ObjectLookupOwnGetter$LWS(HTMLAnchorElement.prototype, 'pathname'); | ||
const HTMLAnchorElementProtoProtocolGetter$LWS = ObjectLookupOwnGetter$LWS(HTMLAnchorElement.prototype, 'protocol'); | ||
function HTMLAnchorElementHostnameGetter(anchor$LWS) { | ||
return ReflectApply(HTMLAnchorElementProtoHostnameGetter$LWS, anchor$LWS, emptyArray); | ||
function HTMLAnchorElementHostnameGetter$LWS(anchor$LWS) { | ||
return ReflectApply$LWS(HTMLAnchorElementProtoHostnameGetter$LWS, anchor$LWS, []); | ||
} | ||
function HTMLAnchorElementHrefGetter(anchor$LWS) { | ||
return ReflectApply(HTMLAnchorElementProtoHrefGetter$LWS, anchor$LWS, emptyArray); | ||
function HTMLAnchorElementHrefGetter$LWS(anchor$LWS) { | ||
return ReflectApply$LWS(HTMLAnchorElementProtoHrefGetter$LWS, anchor$LWS, []); | ||
} | ||
function HTMLAnchorElementHrefSetter(anchor$LWS, href$LWS) { | ||
ReflectApply(HTMLAnchorElementProtoHrefSetter$LWS, anchor$LWS, [href$LWS]); | ||
function HTMLAnchorElementHrefSetter$LWS(anchor$LWS, href$LWS) { | ||
ReflectApply$LWS(HTMLAnchorElementProtoHrefSetter$LWS, anchor$LWS, [href$LWS]); | ||
} | ||
function HTMLAnchorElementPathnameGetter(anchor$LWS) { | ||
return ReflectApply(HTMLAnchorElementProtoPathnameGetter$LWS, anchor$LWS, emptyArray); | ||
function HTMLAnchorElementPathnameGetter$LWS(anchor$LWS) { | ||
return ReflectApply$LWS(HTMLAnchorElementProtoPathnameGetter$LWS, anchor$LWS, []); | ||
} | ||
function HTMLAnchorElementProtocolGetter(anchor$LWS) { | ||
return ReflectApply(HTMLAnchorElementProtoProtocolGetter$LWS, anchor$LWS, emptyArray); | ||
function HTMLAnchorElementProtocolGetter$LWS(anchor$LWS) { | ||
return ReflectApply$LWS(HTMLAnchorElementProtoProtocolGetter$LWS, anchor$LWS, []); | ||
} | ||
const HTMLElementProtoDatasetGetter$LWS = ObjectLookupOwnGetter(HTMLElement.prototype, 'dataset'); | ||
const HTMLElementProtoStyleGetter$LWS = ObjectLookupOwnGetter(HTMLElement.prototype, 'style'); | ||
const HTMLElementProtoDatasetGetter$LWS = ObjectLookupOwnGetter$LWS(HTMLElement.prototype, 'dataset'); | ||
const HTMLElementProtoStyleGetter$LWS = ObjectLookupOwnGetter$LWS(HTMLElement.prototype, 'style'); | ||
function HTMLElementDatasetGetter(el$LWS) { | ||
return ReflectApply(HTMLElementProtoDatasetGetter$LWS, el$LWS, emptyArray); | ||
function HTMLElementDatasetGetter$LWS(el$LWS) { | ||
return ReflectApply$LWS(HTMLElementProtoDatasetGetter$LWS, el$LWS, []); | ||
} | ||
function HTMLElementStyleGetter(el$LWS) { | ||
return ReflectApply(HTMLElementProtoStyleGetter$LWS, el$LWS, emptyArray); | ||
function HTMLElementStyleGetter$LWS(el$LWS) { | ||
return ReflectApply$LWS(HTMLElementProtoStyleGetter$LWS, el$LWS, []); | ||
} | ||
const HTMLIFrameElementProtoContentWindowGetter$LWS = ObjectLookupOwnGetter(HTMLIFrameElement.prototype, 'contentWindow'); | ||
const HTMLIFrameElementProtoSrcSetter$LWS = ObjectLookupOwnSetter(HTMLIFrameElement.prototype, 'src'); | ||
const HTMLIFrameElementProtoContentWindowGetter$LWS = ObjectLookupOwnGetter$LWS(HTMLIFrameElement.prototype, 'contentWindow'); | ||
const HTMLIFrameElementProtoSrcSetter$LWS = ObjectLookupOwnSetter$LWS(HTMLIFrameElement.prototype, 'src'); | ||
function HTMLIFrameElementSrcSetter(iframe$LWS, src$LWS) { | ||
ReflectApply(HTMLIFrameElementProtoSrcSetter$LWS, iframe$LWS, [src$LWS]); | ||
function HTMLIFrameElementSrcSetter$LWS(iframe$LWS, src$LWS) { | ||
ReflectApply$LWS(HTMLIFrameElementProtoSrcSetter$LWS, iframe$LWS, [src$LWS]); | ||
} | ||
function HTMLIFrameElementContentWindowGetter(iframe$LWS) { | ||
return ReflectApply(HTMLIFrameElementProtoContentWindowGetter$LWS, iframe$LWS, emptyArray); | ||
function HTMLIFrameElementContentWindowGetter$LWS(iframe$LWS) { | ||
return ReflectApply$LWS(HTMLIFrameElementProtoContentWindowGetter$LWS, iframe$LWS, []); | ||
} | ||
const { | ||
get: HTMLScriptElementProtoSrcGetter, | ||
set: HTMLScriptElementProtoSrcSetter | ||
} = ReflectGetOwnPropertyDescriptor(HTMLScriptElement.prototype, 'src'); | ||
const NAMESPACE_DEFAULT = 'default'; | ||
const NAMESPACE_SVG = 'http://www.w3.org/2000/svg'; | ||
const NAMESPACE_XHTML = 'http://www.w3.org/1999/xhtml'; | ||
const NAMESPACE_XLINK = 'http://www.w3.org/1999/xlink'; | ||
get: HTMLScriptElementProtoSrcGetter$LWS, | ||
set: HTMLScriptElementProtoSrcSetter$LWS | ||
} = ReflectGetOwnPropertyDescriptor$LWS(HTMLScriptElement.prototype, 'src'); | ||
const NAMESPACE_DEFAULT$LWS = 'default'; | ||
const NAMESPACE_SVG$LWS = 'http://www.w3.org/2000/svg'; | ||
const NAMESPACE_XHTML$LWS = 'http://www.w3.org/1999/xhtml'; | ||
const NAMESPACE_XLINK$LWS = 'http://www.w3.org/1999/xlink'; | ||
const { | ||
createContextualFragment: RangeProtoCreateContextualFragment | ||
createContextualFragment: RangeProtoCreateContextualFragment$LWS | ||
} = Range.prototype; | ||
const RequestProtoURLGetter$LWS = ObjectLookupOwnGetter(Request.prototype, 'url'); // This has to be done 1-by-1 because putting a full file ignore in this file will result in | ||
const RequestProtoURLGetter$LWS = ObjectLookupOwnGetter$LWS(Request.prototype, 'url'); // This has to be done 1-by-1 because putting a full file ignore in this file will result in | ||
// dist/index.js containing the directive and subsequently being ignored. | ||
// istanbul ignore next | ||
function RequestURLGetter(request$LWS) { | ||
return ReflectApply(RequestProtoURLGetter$LWS, request$LWS, emptyArray); | ||
function RequestURLGetter$LWS(request$LWS) { | ||
return ReflectApply$LWS(RequestProtoURLGetter$LWS, request$LWS, []); | ||
} | ||
const { | ||
set: ShadowRootProtoInnerHTMLSetter$LWS | ||
} = ReflectGetOwnPropertyDescriptor(ShadowRoot.prototype, 'innerHTML'); | ||
function ShadowRootInnerHTMLSetter(el$LWS, html$LWS) { | ||
ReflectApply(ShadowRootProtoInnerHTMLSetter$LWS, el$LWS, [html$LWS]); | ||
} | ||
const { | ||
key: StorageProtoKey, | ||
getItem: StorageProtoGetItem, | ||
removeItem: StorageProtoRemoveItem, | ||
setItem: StorageProtoSetItem | ||
key: StorageProtoKey$LWS, | ||
getItem: StorageProtoGetItem$LWS, | ||
removeItem: StorageProtoRemoveItem$LWS, | ||
setItem: StorageProtoSetItem$LWS | ||
} = Storage.prototype; | ||
/** | ||
* The following detection is part of a temporary solution to handle | ||
* "Magic Object" behavior in Safari <= 14. | ||
* | ||
* Properties of HTMLElement.prototype.style, and other CSS style declaration | ||
* objects, will lose their "magic" (i.e. updating the element's style="" attribute) | ||
* if a style property is assigned by a Define Property operation. | ||
* | ||
* This marker will signal to the membrane that it must use a Set operation, | ||
* instead of a Define Property operation. | ||
* | ||
*/ | ||
const SVGElementProtoDatasetGetter$LWS = ObjectLookupOwnGetter$LWS(SVGElement.prototype, 'dataset'); | ||
const HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT = (() => { | ||
const div$LWS = document.createElement('div'); | ||
ReflectDefineProperty(div$LWS.style, 'color', { | ||
// @ts-ignore: TS doesn't like __proto__ on property descriptors. | ||
__proto__: null, | ||
value: 'red' | ||
}); | ||
return div$LWS.getAttribute('style') === ''; | ||
})(); | ||
const SVGElementProtoDatasetGetter$LWS = ObjectLookupOwnGetter(SVGElement.prototype, 'dataset'); | ||
function SVGElementDatasetGetter(svg$LWS) { | ||
return ReflectApply(SVGElementProtoDatasetGetter$LWS, svg$LWS, emptyArray); | ||
function SVGElementDatasetGetter$LWS(svg$LWS) { | ||
return ReflectApply$LWS(SVGElementProtoDatasetGetter$LWS, svg$LWS, []); | ||
} | ||
const { | ||
createObjectURL: URLCreateObjectURL, | ||
revokeObjectURL: URLRevokeObjectURL | ||
createObjectURL: URLCreateObjectURL$LWS, | ||
revokeObjectURL: URLRevokeObjectURL$LWS | ||
} = URL; | ||
const ALLOW_LIST_PATCHED$LWS = ['opener', 'parent']; | ||
const ALLOW_LIST_RAW$LWS = ['close', 'closed', 'focus']; | ||
const DEFAULT_OVERWRITTEN_VALUE$LWS = {}; | ||
const DEFAULT_OVERWRITTEN_VALUE$LWS = {}; // These properties are part of the WindowOrGlobalScope mixin and not on Window.prototype. | ||
// https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope | ||
const { | ||
clearInterval: WindowStaticClearInterval$LWS | ||
clearInterval: WindowStaticClearInterval$LWS, | ||
postMessage: WindowStaticPostMessage$LWS, | ||
setInterval: WindowStaticSetInterval$LWS | ||
} = window; | ||
const WindowStaticLengthGetter$LWS = ObjectLookupOwnGetter(window, 'length'); | ||
const WindowStaticPostMessageValue$LWS = ObjectLookupOwnValue(window, 'postMessage'); | ||
const WindowStaticSelfGetter$LWS = ObjectLookupOwnGetter(window, 'self'); | ||
const WindowStaticLengthGetter$LWS = ObjectLookupOwnGetter$LWS(window, 'length'); | ||
const WindowStaticSelfGetter$LWS = ObjectLookupOwnGetter$LWS(window, 'self'); | ||
function WindowClearInterval(win$LWS, intervalID$LWS) { | ||
return ReflectApply(WindowStaticClearInterval$LWS, win$LWS, [intervalID$LWS]); | ||
function WindowClearInterval$LWS(win$LWS, intervalID$LWS) { | ||
return ReflectApply$LWS(WindowStaticClearInterval$LWS, win$LWS, [intervalID$LWS]); | ||
} | ||
function WindowLengthGetter(win$LWS) { | ||
return ReflectApply(WindowStaticLengthGetter$LWS, win$LWS, emptyArray); | ||
function WindowLengthGetter$LWS(win$LWS) { | ||
return ReflectApply$LWS(WindowStaticLengthGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSelfGetter(win$LWS) { | ||
return ReflectApply(WindowStaticSelfGetter$LWS, win$LWS, emptyArray); | ||
function WindowSelfGetter$LWS(win$LWS) { | ||
return ReflectApply$LWS(WindowStaticSelfGetter$LWS, win$LWS, []); | ||
} | ||
function WindowSetInterval(win$LWS, ...args$LWS) { | ||
return ReflectApply(WindowStaticSetInterval, win$LWS, args$LWS); | ||
function WindowSetInterval$LWS(win$LWS, ...args$LWS) { | ||
return ReflectApply$LWS(WindowStaticSetInterval$LWS, win$LWS, args$LWS); | ||
} | ||
const patchedWindowMap$LWS = new WeakMapCtor(); // istanbul ignore next | ||
const patchedWindowMap$LWS = new WeakMapCtor$LWS(); // istanbul ignore next | ||
function getPatchedWindow(win$LWS) { | ||
function getPatchedWindow$LWS(win$LWS) { | ||
let patchedContentWindow$LWS = null; | ||
if (win$LWS !== null) { | ||
patchedContentWindow$LWS = WeakMapGet(patchedWindowMap$LWS, win$LWS); | ||
patchedContentWindow$LWS = WeakMapGet$LWS(patchedWindowMap$LWS, win$LWS); | ||
if (!patchedContentWindow$LWS) { | ||
patchedContentWindow$LWS = createPatchedWindow$LWS(win$LWS); | ||
WeakMapSet(patchedWindowMap$LWS, win$LWS, patchedContentWindow$LWS); | ||
WeakMapSet$LWS(patchedWindowMap$LWS, win$LWS, patchedContentWindow$LWS); | ||
} | ||
@@ -522,8 +494,8 @@ } | ||
function patchedWindowPostMessageValue(...args$LWS) { | ||
function patchedWindowPostMessage$LWS(...args$LWS) { | ||
const message$LWS = args$LWS.length ? args$LWS[0] : undefined; | ||
if (isObject(message$LWS)) { | ||
if (isObject$LWS(message$LWS)) { | ||
try { | ||
args$LWS[0] = JSONClone(message$LWS); | ||
args$LWS[0] = JSONClone$LWS(message$LWS); | ||
} catch (_unused$LWS) { | ||
@@ -535,3 +507,3 @@ // eslint-disable-next-line @typescript-eslint/no-throw-literal | ||
return ReflectApply(WindowStaticPostMessageValue$LWS, this, args$LWS); | ||
return ReflectApply$LWS(WindowStaticPostMessage$LWS, this, args$LWS); | ||
} // istanbul ignore next | ||
@@ -543,8 +515,10 @@ | ||
for (let i$LWS = 0, len$LWS = ALLOW_LIST_RAW$LWS.length; i$LWS < len$LWS; i$LWS += 1) { | ||
for (let i$LWS = 0, { | ||
length: length$LWS | ||
} = ALLOW_LIST_RAW$LWS; i$LWS < length$LWS; i$LWS += 1) { | ||
const key$LWS = ALLOW_LIST_RAW$LWS[i$LWS]; | ||
const unsafeDesc$LWS = ReflectGetOwnPropertyDescriptor(rawWindow$LWS, key$LWS); | ||
const unsafeDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(rawWindow$LWS, key$LWS); | ||
if (unsafeDesc$LWS) { | ||
const safeDesc$LWS = toSafeDescriptor(unsafeDesc$LWS); | ||
const safeDesc$LWS = toSafeDescriptor$LWS(unsafeDesc$LWS); | ||
const { | ||
@@ -555,7 +529,7 @@ value: originalValue$LWS | ||
if (typeof originalValue$LWS === 'function') { | ||
const bound$LWS = FunctionBind(originalValue$LWS, rawWindow$LWS); | ||
const unsafeNameDesc$LWS = ReflectGetOwnPropertyDescriptor(originalValue$LWS, 'name'); | ||
const bound$LWS = FunctionBind$LWS(originalValue$LWS, rawWindow$LWS); | ||
const unsafeNameDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(originalValue$LWS, 'name'); | ||
if (unsafeNameDesc$LWS) { | ||
ReflectDefineProperty(bound$LWS, 'name', toSafeDescriptor(unsafeNameDesc$LWS)); | ||
ReflectDefineProperty$LWS(bound$LWS, 'name', toSafeDescriptor$LWS(unsafeNameDesc$LWS)); | ||
} | ||
@@ -573,3 +547,3 @@ | ||
safeDesc$LWS.get = function get$LWS() { | ||
return overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS ? ReflectApply(getter$LWS, rawWindow$LWS, emptyArray) : overwrittenValue$LWS; | ||
return overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS ? ReflectApply$LWS(getter$LWS, rawWindow$LWS, []) : overwrittenValue$LWS; | ||
}; | ||
@@ -585,12 +559,14 @@ } | ||
ReflectDefineProperty(patchedWindow$LWS, key$LWS, safeDesc$LWS); | ||
ReflectDefineProperty$LWS(patchedWindow$LWS, key$LWS, safeDesc$LWS); | ||
} | ||
} | ||
for (let i$LWS = 0, len$LWS = ALLOW_LIST_PATCHED$LWS.length; i$LWS < len$LWS; i$LWS += 1) { | ||
for (let i$LWS = 0, { | ||
length: length$LWS | ||
} = ALLOW_LIST_PATCHED$LWS; i$LWS < length$LWS; i$LWS += 1) { | ||
const key$LWS = ALLOW_LIST_PATCHED$LWS[i$LWS]; | ||
const unsafeDesc$LWS = ReflectGetOwnPropertyDescriptor(rawWindow$LWS, key$LWS); | ||
const unsafeDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(rawWindow$LWS, key$LWS); | ||
if (unsafeDesc$LWS) { | ||
const safeDesc$LWS = toSafeDescriptor(unsafeDesc$LWS); | ||
const safeDesc$LWS = toSafeDescriptor$LWS(unsafeDesc$LWS); | ||
const { | ||
@@ -605,3 +581,3 @@ get: getter$LWS, | ||
if (overwrittenValue$LWS === DEFAULT_OVERWRITTEN_VALUE$LWS) { | ||
return getPatchedWindow(ReflectApply(getter$LWS, rawWindow$LWS, emptyArray)); | ||
return getPatchedWindow$LWS(ReflectApply$LWS(getter$LWS, rawWindow$LWS, [])); | ||
} | ||
@@ -619,10 +595,10 @@ | ||
ReflectDefineProperty(patchedWindow$LWS, key$LWS, safeDesc$LWS); | ||
ReflectDefineProperty$LWS(patchedWindow$LWS, key$LWS, safeDesc$LWS); | ||
} | ||
} | ||
const unsafePostMessageDesc$LWS = ReflectGetOwnPropertyDescriptor(rawWindow$LWS, 'postMessage'); | ||
const unsafePostMessageDesc$LWS = ReflectGetOwnPropertyDescriptor$LWS(rawWindow$LWS, 'postMessage'); | ||
if (unsafePostMessageDesc$LWS) { | ||
const safeDesc$LWS = toSafeDescriptor(unsafePostMessageDesc$LWS); | ||
const safeDesc$LWS = toSafeDescriptor$LWS(unsafePostMessageDesc$LWS); | ||
const { | ||
@@ -634,28 +610,25 @@ value: originalValue$LWS | ||
safeDesc$LWS.value = function postMessage$LWS(...args$LWS) { | ||
return ReflectApply(patchedWindowPostMessageValue, rawWindow$LWS, args$LWS); | ||
return ReflectApply$LWS(patchedWindowPostMessage$LWS, rawWindow$LWS, args$LWS); | ||
}; | ||
} | ||
ReflectDefineProperty(patchedWindow$LWS, 'postMessage', safeDesc$LWS); | ||
ReflectDefineProperty$LWS(patchedWindow$LWS, 'postMessage', safeDesc$LWS); | ||
} | ||
return patchedWindow$LWS; | ||
} // setInterval and clearInterval are part of WindowOrGlobalScope mixin, they are | ||
// not on Window.prototype. See https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope. | ||
} | ||
const { | ||
decodeURIComponent: WindowStaticDecodeURIComponent, | ||
encodeURIComponent: WindowStaticEncodeURIComponent, | ||
setInterval: WindowStaticSetInterval | ||
decodeURIComponent: WindowDecodeURIComponent$LWS, | ||
encodeURIComponent: WindowEncodeURIComponent$LWS | ||
} = window; | ||
function isWindowLike(value$LWS) { | ||
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(value$LWS, 'top'); | ||
return ObjectHasOwnProperty$LWS(value$LWS, 'top'); | ||
} | ||
function isWindow(value$LWS) { | ||
function isWindow$LWS(value$LWS) { | ||
// slower check that must certainly detect a window object | ||
@@ -670,3 +643,3 @@ try { | ||
// https://html.spec.whatwg.org/multipage/window-object.html#dom-self | ||
WindowSelfGetter(value$LWS); | ||
WindowSelfGetter$LWS(value$LWS); | ||
return true; // eslint-disable-next-line no-empty | ||
@@ -681,10 +654,10 @@ } catch (_unused2$LWS) {} | ||
const XhrCtor = XMLHttpRequest; | ||
const XhrProto$LWS = XhrCtor.prototype; | ||
const XhrCtor$LWS = XMLHttpRequest; | ||
const XhrProto$LWS = XhrCtor$LWS.prototype; | ||
const { | ||
send: XhrProtoSend$LWS | ||
} = XhrProto$LWS; | ||
const XhrProtoResponseTextGetter$LWS = ObjectLookupOwnGetter(XhrProto$LWS, 'responseText'); | ||
const XhrProtoStatusGetter$LWS = ObjectLookupOwnGetter(XhrProto$LWS, 'status'); | ||
const XhrProtoWithCredentialsSetter$LWS = ObjectLookupOwnSetter(XhrProto$LWS, 'withCredentials'); // istanbul ignore next | ||
const XhrProtoResponseTextGetter$LWS = ObjectLookupOwnGetter$LWS(XhrProto$LWS, 'responseText'); | ||
const XhrProtoStatusGetter$LWS = ObjectLookupOwnGetter$LWS(XhrProto$LWS, 'status'); | ||
const XhrProtoWithCredentialsSetter$LWS = ObjectLookupOwnSetter$LWS(XhrProto$LWS, 'withCredentials'); // istanbul ignore next | ||
@@ -695,27 +668,27 @@ const { | ||
function XhrOpen(xhr$LWS, requestMethod$LWS, url$LWS, async$LWS = true) { | ||
return ReflectApply(XhrProtoOpen$LWS, xhr$LWS, [requestMethod$LWS, url$LWS, async$LWS]); | ||
function XhrOpen$LWS(xhr$LWS, requestMethod$LWS, url$LWS, async$LWS = true) { | ||
return ReflectApply$LWS(XhrProtoOpen$LWS, xhr$LWS, [requestMethod$LWS, url$LWS, async$LWS]); | ||
} // istanbul ignore next | ||
function XhrResponseTextGetter(xhr$LWS) { | ||
return ReflectApply(XhrProtoResponseTextGetter$LWS, xhr$LWS, emptyArray); | ||
function XhrResponseTextGetter$LWS(xhr$LWS) { | ||
return ReflectApply$LWS(XhrProtoResponseTextGetter$LWS, xhr$LWS, []); | ||
} // istanbul ignore next | ||
function XhrSend(xhr$LWS) { | ||
return ReflectApply(XhrProtoSend$LWS, xhr$LWS, emptyArray); | ||
function XhrSend$LWS(xhr$LWS) { | ||
return ReflectApply$LWS(XhrProtoSend$LWS, xhr$LWS, []); | ||
} // istanbul ignore next | ||
function XhrStatusGetter(xhr$LWS) { | ||
return ReflectApply(XhrProtoStatusGetter$LWS, xhr$LWS, emptyArray); | ||
function XhrStatusGetter$LWS(xhr$LWS) { | ||
return ReflectApply$LWS(XhrProtoStatusGetter$LWS, xhr$LWS, []); | ||
} // istanbul ignore next | ||
function XhrWithCredentialsSetter(xhr$LWS, bool$LWS) { | ||
ReflectApply(XhrProtoWithCredentialsSetter$LWS, xhr$LWS, [bool$LWS]); | ||
function XhrWithCredentialsSetter$LWS(xhr$LWS, bool$LWS) { | ||
ReflectApply$LWS(XhrProtoWithCredentialsSetter$LWS, xhr$LWS, [bool$LWS]); | ||
} | ||
export { AttrNameGetter, AttrNamespaceURIGetter, AttrOwnerElementGetter, AttrValueGetter, AttrValueSetter, BlobCtor, BlobSizeGetter, BlobSlice, BlobTypeGetter, DOMImplementationCreateDocument, DOMTokenListValueGetter, DocumentBodyGetter, DocumentCookieGetter, DocumentCookieSetter, DocumentCreateComment, DocumentCreateElement, DocumentCreateElementNS, DocumentDocumentElementGetter, DocumentFragmentGetElementById, DocumentGetElementById, DocumentHeadGetter, DocumentImplementation, ElementClosest, ElementGetAttributeNode, ElementGetAttributeNodeNS, ElementGetNamespaceURI, ElementInnerHTMLGetter, ElementInnerHTMLSetter, ElementOuterHTMLGetter, ElementProtoSetAttribute, ElementProtoSetAttributeNS, ElementQuerySelector, ElementRemove, ElementRemoveAttributeNode, ElementSetAttribute, ElementSetAttributeNS, EventCurrentTargetGetter, EventTargetAddEventListener, HAS_BREAKABLE_CSS_STYLE_DECLARATION_MAGIC_OBJECT, HTMLAnchorElementHostnameGetter, HTMLAnchorElementHrefGetter, HTMLAnchorElementHrefSetter, HTMLAnchorElementPathnameGetter, HTMLAnchorElementProtocolGetter, HTMLElementDatasetGetter, HTMLElementStyleGetter, HTMLIFrameElementContentWindowGetter, HTMLIFrameElementSrcSetter, HTMLScriptElementProtoSrcGetter, HTMLScriptElementProtoSrcSetter, HTMLTemplateElementContentGetter, JSONClone, NAMESPACE_DEFAULT, NAMESPACE_SVG, NAMESPACE_XHTML, NAMESPACE_XLINK, NodeAppendChild, NodeChildNodesGetter, NodeClone, NodeFirstChildGetter, NodeIsEqualNode, NodeLastChildGetter, NodeNameGetter, NodeOwnerDocumentGetter, RangeProtoCreateContextualFragment, RequestURLGetter, SVGElementDatasetGetter, ShadowRootInnerHTMLSetter, StorageProtoGetItem, StorageProtoKey, StorageProtoRemoveItem, StorageProtoSetItem, URLCreateObjectURL, URLRevokeObjectURL, WindowClearInterval, WindowLengthGetter, WindowSelfGetter, WindowSetInterval, WindowStaticDecodeURIComponent, WindowStaticEncodeURIComponent, WindowStaticSetInterval, XhrCtor, XhrOpen, XhrResponseTextGetter, XhrSend, XhrStatusGetter, XhrWithCredentialsSetter, getPatchedWindow, getValidator, isWindow, isWindowLike, nsCookieKey, nsCookieRootKey, patchedWindowPostMessageValue }; | ||
/*! version: 0.15.4 */ | ||
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, 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, getPatchedWindow$LWS as getPatchedWindow, getValidator$LWS as getValidator, isWindow$LWS as isWindow, isWindowLike$LWS as isWindowLike, nsCookieKey$LWS as nsCookieKey, nsCookieRootKey$LWS as nsCookieRootKey, patchedWindowPostMessage$LWS as patchedWindowPostMessage }; | ||
/*! version: 0.15.5 */ |
{ | ||
"name": "@locker/shared-dom", | ||
"version": "0.15.4", | ||
"version": "0.15.5", | ||
"license": "Salesforce Developer Agreement", | ||
@@ -20,3 +20,3 @@ "author": "Salesforce UI Security Team", | ||
"dependencies": { | ||
"@locker/shared": "0.15.4" | ||
"@locker/shared": "0.15.5" | ||
}, | ||
@@ -27,3 +27,3 @@ "files": [ | ||
], | ||
"gitHead": "bc643ba0793f6915a3c4ff4e95ac1cba6c1b5165" | ||
"gitHead": "9908c09daf0ae97dc6ea9afc4bfeee6dc8ad085d" | ||
} |
@@ -20,5 +20,3 @@ export * from './Attr'; | ||
export * from './Request'; | ||
export * from './ShadowRoot'; | ||
export * from './Storage'; | ||
export * from './support'; | ||
export * from './SVGElement'; | ||
@@ -25,0 +23,0 @@ export * from './types'; |
export interface CookieStore extends EventTarget { | ||
delete: Function; | ||
get: Function; | ||
getAll: Function; | ||
set: Function; | ||
prototype: object; | ||
prototype: { | ||
delete: Function; | ||
get: Function; | ||
getAll: Function; | ||
set: Function; | ||
}; | ||
} | ||
@@ -8,0 +9,0 @@ declare global { |
@@ -7,6 +7,6 @@ import { GlobalObject } from './types'; | ||
export declare function getPatchedWindow<T extends GlobalObject | null>(win: T): T; | ||
export declare function patchedWindowPostMessageValue(this: GlobalObject, ...args: any[]): void; | ||
export declare const WindowStaticDecodeURIComponent: typeof decodeURIComponent, WindowStaticEncodeURIComponent: typeof encodeURIComponent, WindowStaticSetInterval: ((handler: TimerHandler, timeout?: number | undefined, ...arguments: any[]) => number) & typeof setInterval; | ||
export declare function patchedWindowPostMessage(this: GlobalObject, ...args: any[]): void; | ||
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
92284
57
1307
1
+ Added@locker/shared@0.15.5(transitive)
- Removed@locker/shared@0.15.4(transitive)
Updated@locker/shared@0.15.5