chore: init map prototype methods eagerly (#10544)

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/10553/head
Rich Harris 11 months ago committed by GitHub
parent 7032837ef0
commit 4c9d71f8cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -14,7 +14,10 @@ var element_prototype;
var text_prototype; var text_prototype;
/** @type {Map<any, any>} */ /** @type {Map<any, any>} */
var map_prototype; var map_prototype = Map.prototype;
var map_set_method = map_prototype.set;
var map_get_method = map_prototype.get;
var map_delete_method = map_prototype.delete;
/** @type {typeof Node.prototype.appendChild} */ /** @type {typeof Node.prototype.appendChild} */
var append_child_method; var append_child_method;
@ -22,15 +25,6 @@ var append_child_method;
/** @type {typeof Node.prototype.cloneNode} */ /** @type {typeof Node.prototype.cloneNode} */
var clone_node_method; var clone_node_method;
/** @type {typeof Map.prototype.set} */
var map_set_method;
/** @type {typeof Map.prototype.get} */
var map_get_method;
/** @type {typeof Map.prototype.delete} */
var map_delete_method;
/** @type {(this: Node) => ChildNode | null} */ /** @type {(this: Node) => ChildNode | null} */
var first_child_get; var first_child_get;
@ -65,13 +59,9 @@ export function init_operations() {
node_prototype = Node.prototype; node_prototype = Node.prototype;
element_prototype = Element.prototype; element_prototype = Element.prototype;
text_prototype = Text.prototype; text_prototype = Text.prototype;
map_prototype = Map.prototype;
append_child_method = node_prototype.appendChild; append_child_method = node_prototype.appendChild;
clone_node_method = node_prototype.cloneNode; clone_node_method = node_prototype.cloneNode;
map_set_method = map_prototype.set;
map_get_method = map_prototype.get;
map_delete_method = map_prototype.delete;
$window = window; $window = window;
$document = document; $document = document;

Loading…
Cancel
Save