Skip to content

Commit

Permalink
fix: stop enabling O.p.constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed Feb 28, 2021
1 parent 9228727 commit eeb8cce
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
9 changes: 7 additions & 2 deletions packages/ses/src/enablements.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,15 @@
* leads to another record explaining which properties {@code
* Function.prototype} need to be repaired.
*/

export const moderateEnablements = {
'%ObjectPrototype%': {
constructor: true, // set by "acorn" v7.
// Note that acorn 7 does override `constructor` by assignment, but
// this is fixed as of acorn 8. Including
// ```js
// constructor: true, // set by acorn 7
// ```
// in this list confuses the Node console, so please update all
// acorn dependencies to at least 8 instead.
hasOwnProperty: true, // set by "vega-util".
toString: true,
valueOf: true,
Expand Down
7 changes: 1 addition & 6 deletions packages/ses/test/test-enable-property-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,7 @@ test('enablePropertyOverrides - on', t => {

harden(intrinsics);

testOverriding(t, 'Object', {}, [
'constructor',
'hasOwnProperty',
'toString',
'valueOf',
]);
testOverriding(t, 'Object', {}, ['hasOwnProperty', 'toString', 'valueOf']);
// We allow 'length' *not* because it is in enablements; it is not;
// but because each array instance has its own.
testOverriding(t, 'Array', [], ['toString', 'length']);
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,7 @@ acorn-globals@^4.3.0:
resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7"
integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==
dependencies:
acorn "^6.0.1"
acorn "^8.0.1".0.1"
acorn-walk "^6.0.1"

acorn-jsx@^5.2.0:
Expand All @@ -2450,7 +2450,7 @@ acorn-node@^1.2.0, acorn-node@^1.3.0, acorn-node@^1.5.2, acorn-node@^1.6.1:
resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.8.2.tgz#114c95d64539e53dede23de8b9d96df7c7ae2af8"
integrity sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==
dependencies:
acorn "^7.0.0"
acorn "^8.0.1"
acorn-walk "^7.0.0"
xtend "^4.0.2"

Expand Down Expand Up @@ -5467,7 +5467,7 @@ espree@^6.1.2:
resolved "https://registry.yarnpkg.com/espree/-/espree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a"
integrity sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==
dependencies:
acorn "^7.1.1"
acorn "^8.0.1"
acorn-jsx "^5.2.0"
eslint-visitor-keys "^1.1.0"

Expand Down Expand Up @@ -5673,7 +5673,7 @@ falafel@^2.1.0:
resolved "https://registry.yarnpkg.com/falafel/-/falafel-2.2.4.tgz#b5d86c060c2412a43166243cb1bce44d1abd2819"
integrity sha512-0HXjo8XASWRmsS0X1EkhwEMZaD3Qvp7FfURwjLKjG1ghfRm/MGZl2r4cWUTv41KdNghTw4OUMmVtdGQp3+H+uQ==
dependencies:
acorn "^7.1.1"
acorn "^8.0.1"
foreach "^2.0.5"
isarray "^2.0.1"
object-keys "^1.0.6"
Expand Down Expand Up @@ -7606,7 +7606,7 @@ jsdom@^14.1.0:
integrity sha512-O901mfJSuTdwU2w3Sn+74T+RnDVP+FuV5fH8tcPWyqrseRAb0s5xOtPgCFiPOtLcyK7CLIJwPyD83ZqQWvA5ng==
dependencies:
abab "^2.0.0"
acorn "^6.0.4"
acorn "^8.0.1".0.4"
acorn-globals "^4.3.0"
array-equal "^1.0.0"
cssom "^0.3.4"
Expand Down Expand Up @@ -11038,7 +11038,7 @@ rollup@1.31.0:
dependencies:
"@types/estree" "*"
"@types/node" "*"
acorn "^7.1.0"
acorn "^8.0.1"

rollup@^2.0.0:
version "2.34.1"
Expand Down Expand Up @@ -12972,7 +12972,7 @@ webpack@^4.29.6:
"@webassemblyjs/helper-module-context" "1.9.0"
"@webassemblyjs/wasm-edit" "1.9.0"
"@webassemblyjs/wasm-parser" "1.9.0"
acorn "^6.4.1"
acorn "^8.0.1".4.1"
ajv "^6.10.2"
ajv-keywords "^3.4.1"
chrome-trace-event "^1.0.2"
Expand Down

0 comments on commit eeb8cce

Please sign in to comment.