summaryrefslogtreecommitdiff
path: root/ext/web/02_event.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-01-06 21:45:23 +0900
committerGitHub <noreply@github.com>2023-01-06 21:45:23 +0900
commitff89ff4abba39ce158056d390e761495f5a7bc86 (patch)
tree03a9c71b5bb3889842db06ed41c3999074c4107a /ext/web/02_event.js
parent39cbaa6d34c249afc4b197836da1fa6dd143cbf9 (diff)
perf(ext,runtime): remove using `SafeArrayIterator` from `for-of` (#17255)
Diffstat (limited to 'ext/web/02_event.js')
-rw-r--r--ext/web/02_event.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/web/02_event.js b/ext/web/02_event.js
index 3e7a4d108..dac126280 100644
--- a/ext/web/02_event.js
+++ b/ext/web/02_event.js
@@ -428,7 +428,8 @@
Ctor,
props,
) {
- for (const prop of new SafeArrayIterator(props)) {
+ for (let i = 0; i < props.length; ++i) {
+ const prop = props[i];
ReflectDefineProperty(Ctor.prototype, prop, { enumerable: true });
}
}
@@ -969,7 +970,9 @@
listeners[type] = [];
}
- for (const listener of new SafeArrayIterator(listeners[type])) {
+ const listenerList = listeners[type];
+ for (let i = 0; i < listenerList.length; ++i) {
+ const listener = listenerList[i];
if (
((typeof listener.options === "boolean" &&
listener.options === options.capture) ||
@@ -1454,7 +1457,9 @@
colno = jsError.frames[0].columnNumber;
} else {
const jsError = core.destructureError(new Error());
- for (const frame of new SafeArrayIterator(jsError.frames)) {
+ const frames = jsError.frames;
+ for (let i = 0; i < frames.length; ++i) {
+ const frame = frames[i];
if (
typeof frame.fileName == "string" &&
!StringPrototypeStartsWith(frame.fileName, "deno:")