summaryrefslogtreecommitdiff
path: root/core/01_core.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-05-21 22:23:28 +0200
committerGitHub <noreply@github.com>2023-05-21 20:23:28 +0000
commit9ec49897766d9c22f6c7bafabdd3e3f3a4b68ab1 (patch)
treee618fc4b47a720ce2392794a73735c7e28c3ca4c /core/01_core.js
parentaddfb0c546f3cd911514591a91a9eef2ce5e3cec (diff)
refactor(core): set function names for ops in JavaScript (#19208)
This commit ensures that JavaScript functions generated for registered ops have proper names set up - the function name matches the name of the op. A test was added in `core/runtime.rs` that verifies this. Closes https://github.com/denoland/deno/issues/19206
Diffstat (limited to 'core/01_core.js')
-rw-r--r--core/01_core.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/01_core.js b/core/01_core.js
index 403a04297..c3033fcf9 100644
--- a/core/01_core.js
+++ b/core/01_core.js
@@ -14,6 +14,7 @@
MapPrototypeHas,
MapPrototypeSet,
ObjectAssign,
+ ObjectDefineProperty,
ObjectFreeze,
ObjectFromEntries,
ObjectKeys,
@@ -561,6 +562,11 @@ for (let i = 0; i < 10; i++) {
})`,
);
}
+ ObjectDefineProperty(fn, "name", {
+ value: opName,
+ configurable: false,
+ writable: false,
+ });
return (ops[opName] = fn);
}