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

* Depends on: denoland/deno_core#207
  • Loading branch information
lrowe committed Nov 28, 2023
1 parent d65a297 commit e683ab7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ext/web/13_message_port.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,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 e683ab7

Please sign in to comment.