Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ses): enablements needed by (old?) mobx #2030

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/ses/src/enablements.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { toStringTagSymbol } from './commons.js';
import { toStringTagSymbol, iteratorSymbol } from './commons.js';

/**
* @file Exports {@code enablements}, a recursively defined
Expand Down Expand Up @@ -97,6 +97,8 @@ export const moderateEnablements = {
'%ArrayPrototype%': {
toString: true,
push: true, // set by "Google Analytics"
concat: true, // set by mobx generated code (old TS compiler?)
[iteratorSymbol]: true, // set by mobx generated code (old TS compiler?)
},

// Function.prototype has no 'prototype' property to enable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test('enablePropertyOverrides - on', t => {
overrideTester(t, 'Object', {}, ['toString', 'valueOf']);
// We allow 'length' *not* because it is in enablements; it is not;
// but because each array instance has its own.
overrideTester(t, 'Array', [], ['toString', 'length', 'push']);
overrideTester(t, 'Array', [], ['toString', 'length', 'push', 'concat']);
// eslint-disable-next-line func-names, prefer-arrow-callback
overrideTester(t, 'Function', function () {}, [
'constructor',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test('enablePropertyOverrides - on, with debug', t => {

// We allow 'length' *not* because it is in enablements; it is not;
// but because each array instance has its own.
overrideTester(t, 'Array', [], ['toString', 'length', 'push']);
overrideTester(t, 'Array', [], ['toString', 'length', 'push', 'concat']);

const TypedArray = getPrototypeOf(Uint8Array);
overrideTester(
Expand Down
2 changes: 1 addition & 1 deletion packages/ses/test/test-enable-property-overrides-severe.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test('enablePropertyOverrides - on', t => {

// We allow 'length' *not* because it is in enablements; it is not;
// but because each array instance has its own.
overrideTester(t, 'Array', [], ['toString', 'length', 'push']);
overrideTester(t, 'Array', [], ['toString', 'length', 'push', 'concat']);

const TypedArray = getPrototypeOf(Uint8Array);
overrideTester(
Expand Down
Loading