mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 19:08:15 +00:00
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>
This commit is contained in:
parent
6c167c64d6
commit
971f09abe4
32 changed files with 141 additions and 92 deletions
|
@ -91,7 +91,7 @@ class Worker extends EventTarget {
|
|||
// still be messages left to receive.
|
||||
#status = "RUNNING";
|
||||
|
||||
constructor(specifier, options = {}) {
|
||||
constructor(specifier, options = { __proto__: null }) {
|
||||
super();
|
||||
specifier = String(specifier);
|
||||
const {
|
||||
|
@ -254,7 +254,7 @@ class Worker extends EventTarget {
|
|||
}
|
||||
};
|
||||
|
||||
postMessage(message, transferOrOptions = {}) {
|
||||
postMessage(message, transferOrOptions = { __proto__: null }) {
|
||||
const prefix = "Failed to execute 'postMessage' on 'MessagePort'";
|
||||
webidl.requiredArguments(arguments.length, 1, prefix);
|
||||
message = webidl.converters.any(message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue