Skip to content

Commit

Permalink
@W-16440795: Never remap Set and Map regardless of MaxPerfMode or Max…
Browse files Browse the repository at this point in the history
…CompatMode (#467)

* @W-16440795: Never remap Set and Map regardless of MaxPerfMode or MaxCompatMode

* Removed incorrect comments

---------

Co-authored-by: Rick Waldron <[email protected]>
  • Loading branch information
manuel-jasso and rwaldron authored Aug 12, 2024
1 parent e179fa8 commit 74092ef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions packages/near-membrane-base/src/__tests__/intrinsics.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ const ReflectiveIntrinsicObjectNames = [
const RemappedIntrinsicObjectNames = [
'Date',
'Intl',
'Map',
// 'Map',
'Promise',
'Set',
'WeakMap',
'WeakSet',
// 'Set',
// 'WeakMap',
// 'WeakSet',
];

const TypedAraysInstrinsics = [
const TypedArraysInstrinsics = [
'ArrayBuffer',
'Atomics',
'BigInt64Array',
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('assignFilteredGlobalDescriptorsFromPropertyDescriptorMap', () => {
}
});
it('includes Remapped ES intrinsics', () => {
const remappedObjectNames = [...RemappedIntrinsicObjectNames, ...TypedAraysInstrinsics];
const remappedObjectNames = [...RemappedIntrinsicObjectNames, ...TypedArraysInstrinsics];
expect.assertions(remappedObjectNames.length);

const shape = remappedObjectNames.reduce((accum, key) => {
Expand Down Expand Up @@ -220,7 +220,7 @@ describe('getFilteredGlobalOwnKeys', () => {
}
});
it('includes Remapped ES intrinsics', () => {
const remappedObjectNames = [...RemappedIntrinsicObjectNames, ...TypedAraysInstrinsics];
const remappedObjectNames = [...RemappedIntrinsicObjectNames, ...TypedArraysInstrinsics];
const shape = remappedObjectNames.reduce((accum, key) => {
(accum as any)[key] = (globalThis as any)[key];
return accum;
Expand Down
8 changes: 4 additions & 4 deletions packages/near-membrane-base/src/intrinsics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function getESGlobalKeys(maxPerfMode: boolean) {
// 'EvalError', // Reflective
'FinalizationRegistry',
// 'Function', // dangerous & Reflective
// 'Map', // Remapped
'Map',
'Number',
// 'Object', // Reflective
// Allow blue `Promise` constructor to overwrite the Red one so that promises
Expand All @@ -66,15 +66,15 @@ function getESGlobalKeys(maxPerfMode: boolean) {
// 'RangeError', // Reflective
// 'ReferenceError', // Reflective
'RegExp',
// 'Set', // Remapped
'Set',

'String',
'Symbol',
// 'SyntaxError', // Reflective
// 'TypeError', // Reflective
// 'URIError', // Reflective
// 'WeakMap', // Remapped
// 'WeakSet', // Remapped
'WeakMap',
'WeakSet',
'WeakRef',

// *** 18.4 Other Properties of the Global Object
Expand Down

0 comments on commit 74092ef

Please sign in to comment.