Skip to content

chore: init map prototype methods eagerly #10544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions packages/svelte/src/internal/client/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,17 @@ var element_prototype;
var text_prototype;

/** @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} */
var append_child_method;

/** @type {typeof Node.prototype.cloneNode} */
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} */
var first_child_get;

Expand Down Expand Up @@ -65,13 +59,9 @@ export function init_operations() {
node_prototype = Node.prototype;
element_prototype = Element.prototype;
text_prototype = Text.prototype;
map_prototype = Map.prototype;

append_child_method = node_prototype.appendChild;
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;
$document = document;
Expand Down