summaryrefslogtreecommitdiff
path: root/ext/web/13_message_port.js
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2024-05-23 00:03:35 +0200
committerGitHub <noreply@github.com>2024-05-23 00:03:35 +0200
commit971f09abe486185247e1faf4e8d1419ba2506b8d (patch)
tree3ed0cf608116ad06e88a87552333e930824cc790 /ext/web/13_message_port.js
parent6c167c64d61ecfc912dc1b68d300f02aa3677235 (diff)
fix(runtime): use more null proto objects (#23921)
This is a primordialization effort to improve resistance against users tampering with the global `Object` prototype. --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'ext/web/13_message_port.js')
-rw-r--r--ext/web/13_message_port.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/web/13_message_port.js b/ext/web/13_message_port.js
index 93145e8f7..d94ca1382 100644
--- a/ext/web/13_message_port.js
+++ b/ext/web/13_message_port.js
@@ -150,7 +150,7 @@ class MessagePort extends EventTarget {
* @param {any} message
* @param {object[] | StructuredSerializeOptions} transferOrOptions
*/
- postMessage(message, transferOrOptions = {}) {
+ postMessage(message, transferOrOptions = { __proto__: null }) {
webidl.assertBranded(this, MessagePortPrototype);
const prefix = "Failed to execute 'postMessage' on 'MessagePort'";
webidl.requiredArguments(arguments.length, 1, prefix);