Skip to content

Commit

Permalink
perf(ext/web): Avoid changing prototype by setting hostObjectBrand di…
Browse files Browse the repository at this point in the history
…rectly (#21358)
  • Loading branch information
lrowe committed Nov 30, 2023
1 parent ffa0954 commit 8050cbf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
13 changes: 7 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 40,7 @@ repository = "https://github.com/denoland/deno"

[workspace.dependencies]
deno_ast = { version = "0.31.6", features = ["transpiling"] }
deno_core = { version = "0.233.0" }
deno_core = { version = "0.234.0" }

deno_runtime = { version = "0.133.0", path = "./runtime" }
napi_sym = { version = "0.55.0", path = "./cli/napi/sym" }
Expand Down
6 changes: 2 additions & 4 deletions ext/web/13_message_port.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 26,6 @@ const {
ArrayPrototypeIncludes,
ArrayPrototypePush,
ObjectPrototypeIsPrototypeOf,
ObjectSetPrototypeOf,
Symbol,
SymbolFor,
SymbolIterator,
Expand Down Expand Up @@ -84,9 83,8 @@ const _enabled = Symbol("enabled");
* @returns {MessagePort}
*/
function createMessagePort(id) {
const port = core.createHostObject();
ObjectSetPrototypeOf(port, MessagePortPrototype);
port[webidl.brand] = webidl.brand;
const port = webidl.createBranded(MessagePort);
port[core.hostObjectBrand] = core.hostObjectBrand;
setEventTargetData(port);
port[_id] = id;
return port;
Expand Down

0 comments on commit 8050cbf

Please sign in to comment.