diff options
author | Luca Casonato <hello@lcas.dev> | 2024-05-23 00:03:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-23 00:03:35 +0200 |
commit | 971f09abe486185247e1faf4e8d1419ba2506b8d (patch) | |
tree | 3ed0cf608116ad06e88a87552333e930824cc790 /ext/web/15_performance.js | |
parent | 6c167c64d61ecfc912dc1b68d300f02aa3677235 (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/15_performance.js')
-rw-r--r-- | ext/web/15_performance.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/web/15_performance.js b/ext/web/15_performance.js index adaa501b5..5045c0d31 100644 --- a/ext/web/15_performance.js +++ b/ext/web/15_performance.js @@ -234,7 +234,7 @@ class PerformanceMark extends PerformanceEntry { constructor( name, - options = {}, + options = { __proto__: null }, ) { const prefix = "Failed to construct 'PerformanceMark'"; webidl.requiredArguments(arguments.length, 1, prefix); @@ -441,7 +441,7 @@ class Performance extends EventTarget { mark( markName, - markOptions = {}, + markOptions = { __proto__: null }, ) { webidl.assertBranded(this, PerformancePrototype); const prefix = "Failed to execute 'mark' on 'Performance'"; @@ -466,7 +466,7 @@ class Performance extends EventTarget { measure( measureName, - startOrMeasureOptions = {}, + startOrMeasureOptions = { __proto__: null }, endMark = undefined, ) { webidl.assertBranded(this, PerformancePrototype); |