summaryrefslogtreecommitdiff
path: root/ext/web/01_dom_exception.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/01_dom_exception.js
parent39cbaa6d34c249afc4b197836da1fa6dd143cbf9 (diff)
perf(ext,runtime): remove using `SafeArrayIterator` from `for-of` (#17255)
Diffstat (limited to 'ext/web/01_dom_exception.js')
-rw-r--r--ext/web/01_dom_exception.js61
1 files changed, 29 insertions, 32 deletions
diff --git a/ext/web/01_dom_exception.js b/ext/web/01_dom_exception.js
index 63b82b01f..031558bee 100644
--- a/ext/web/01_dom_exception.js
+++ b/ext/web/01_dom_exception.js
@@ -19,7 +19,6 @@
ObjectEntries,
ObjectPrototypeIsPrototypeOf,
ObjectSetPrototypeOf,
- SafeArrayIterator,
Symbol,
SymbolFor,
} = window.__bootstrap.primordials;
@@ -166,37 +165,35 @@
webidl.configurePrototype(DOMException);
const DOMExceptionPrototype = DOMException.prototype;
- for (
- const [key, value] of new SafeArrayIterator(
- ObjectEntries({
- INDEX_SIZE_ERR,
- DOMSTRING_SIZE_ERR,
- HIERARCHY_REQUEST_ERR,
- WRONG_DOCUMENT_ERR,
- INVALID_CHARACTER_ERR,
- NO_DATA_ALLOWED_ERR,
- NO_MODIFICATION_ALLOWED_ERR,
- NOT_FOUND_ERR,
- NOT_SUPPORTED_ERR,
- INUSE_ATTRIBUTE_ERR,
- INVALID_STATE_ERR,
- SYNTAX_ERR,
- INVALID_MODIFICATION_ERR,
- NAMESPACE_ERR,
- INVALID_ACCESS_ERR,
- VALIDATION_ERR,
- TYPE_MISMATCH_ERR,
- SECURITY_ERR,
- NETWORK_ERR,
- ABORT_ERR,
- URL_MISMATCH_ERR,
- QUOTA_EXCEEDED_ERR,
- TIMEOUT_ERR,
- INVALID_NODE_TYPE_ERR,
- DATA_CLONE_ERR,
- }),
- )
- ) {
+ const entries = ObjectEntries({
+ INDEX_SIZE_ERR,
+ DOMSTRING_SIZE_ERR,
+ HIERARCHY_REQUEST_ERR,
+ WRONG_DOCUMENT_ERR,
+ INVALID_CHARACTER_ERR,
+ NO_DATA_ALLOWED_ERR,
+ NO_MODIFICATION_ALLOWED_ERR,
+ NOT_FOUND_ERR,
+ NOT_SUPPORTED_ERR,
+ INUSE_ATTRIBUTE_ERR,
+ INVALID_STATE_ERR,
+ SYNTAX_ERR,
+ INVALID_MODIFICATION_ERR,
+ NAMESPACE_ERR,
+ INVALID_ACCESS_ERR,
+ VALIDATION_ERR,
+ TYPE_MISMATCH_ERR,
+ SECURITY_ERR,
+ NETWORK_ERR,
+ ABORT_ERR,
+ URL_MISMATCH_ERR,
+ QUOTA_EXCEEDED_ERR,
+ TIMEOUT_ERR,
+ INVALID_NODE_TYPE_ERR,
+ DATA_CLONE_ERR,
+ });
+ for (let i = 0; i < entries.length; ++i) {
+ const [key, value] = entries[i];
const desc = { value, enumerable: true };
ObjectDefineProperty(DOMException, key, desc);
ObjectDefineProperty(DOMException.prototype, key, desc);