|
|
@ -3,26 +3,11 @@ import { DEV } from 'esm-env';
|
|
|
|
import { init_array_prototype_warnings } from '../dev/equality.js';
|
|
|
|
import { init_array_prototype_warnings } from '../dev/equality.js';
|
|
|
|
import { current_effect } from '../runtime.js';
|
|
|
|
import { current_effect } from '../runtime.js';
|
|
|
|
|
|
|
|
|
|
|
|
// We cache the Node and Element prototype methods, so that we can avoid doing
|
|
|
|
|
|
|
|
// expensive prototype chain lookups.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {Node} */
|
|
|
|
|
|
|
|
var node_prototype;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {Element} */
|
|
|
|
|
|
|
|
var element_prototype;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {Text} */
|
|
|
|
|
|
|
|
var text_prototype;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// export these for reference in the compiled code, making global name deduplication unnecessary
|
|
|
|
// export these for reference in the compiled code, making global name deduplication unnecessary
|
|
|
|
/**
|
|
|
|
/** @type {Window} */
|
|
|
|
* @type {Window}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
export var $window;
|
|
|
|
export var $window;
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @type {Document}
|
|
|
|
/** @type {Document} */
|
|
|
|
*/
|
|
|
|
|
|
|
|
export var $document;
|
|
|
|
export var $document;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -30,29 +15,28 @@ export var $document;
|
|
|
|
* where these globals are not available while avoiding a separate server entry point
|
|
|
|
* where these globals are not available while avoiding a separate server entry point
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
export function init_operations() {
|
|
|
|
export function init_operations() {
|
|
|
|
if (node_prototype !== undefined) {
|
|
|
|
if ($window !== undefined) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
node_prototype = Node.prototype;
|
|
|
|
|
|
|
|
element_prototype = Element.prototype;
|
|
|
|
|
|
|
|
text_prototype = Text.prototype;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$window = window;
|
|
|
|
$window = window;
|
|
|
|
$document = document;
|
|
|
|
$document = document;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var element_prototype = Element.prototype;
|
|
|
|
|
|
|
|
|
|
|
|
// the following assignments improve perf of lookups on DOM nodes
|
|
|
|
// the following assignments improve perf of lookups on DOM nodes
|
|
|
|
// @ts-expect-error
|
|
|
|
// @ts-expect-error
|
|
|
|
element_prototype.__click = undefined;
|
|
|
|
element_prototype.__click = undefined;
|
|
|
|
// @ts-expect-error
|
|
|
|
// @ts-expect-error
|
|
|
|
text_prototype.__nodeValue = ' ';
|
|
|
|
|
|
|
|
// @ts-expect-error
|
|
|
|
|
|
|
|
element_prototype.__className = '';
|
|
|
|
element_prototype.__className = '';
|
|
|
|
// @ts-expect-error
|
|
|
|
// @ts-expect-error
|
|
|
|
element_prototype.__attributes = null;
|
|
|
|
element_prototype.__attributes = null;
|
|
|
|
// @ts-expect-error
|
|
|
|
// @ts-expect-error
|
|
|
|
element_prototype.__e = undefined;
|
|
|
|
element_prototype.__e = undefined;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @ts-expect-error
|
|
|
|
|
|
|
|
Text.prototype.__nodeValue = ' ';
|
|
|
|
|
|
|
|
|
|
|
|
if (DEV) {
|
|
|
|
if (DEV) {
|
|
|
|
// @ts-expect-error
|
|
|
|
// @ts-expect-error
|
|
|
|
element_prototype.__svelte_meta = null;
|
|
|
|
element_prototype.__svelte_meta = null;
|
|
|
|