-
Notifications
You must be signed in to change notification settings - Fork 27
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
@W-16383704: Convert near-membrane's binary data tests to MaxPerf/MaxCompat #459
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bc939ba
Upgrade Karma Firefox Launcher
manuel-jasso 8dfcf96
Integrate file-fixtures-preprocessor
manuel-jasso 6fe0ebf
Renamed `remapTypedArrays` to `maxCompatMode`
manuel-jasso 973118a
Centralized all the objects that must be from the same global object …
manuel-jasso 5e4dd29
Created `maxPerfModeKeys` array and added `Atomics` to it
manuel-jasso bd85ff9
Renamed maxCompatMode to maxPerfMode and flipped the logic
manuel-jasso 2c9970e
Added .npmrc and .yarnrc
manuel-jasso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ dist/ | |
node_modules/ | ||
types/ | ||
*/**/bundle.js | ||
**/untrusted/**/*.js |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
registry=https://registry.yarnpkg.com | ||
save-exact=true | ||
package-lock=false | ||
scripts-prepend-node-path=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
save-prefix "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ import { VirtualEnvironment } from './environment'; | |
* problematic, and requires a lot more work to guarantee that objects from both sides | ||
* can be considered equivalents (without identity discontinuity). | ||
*/ | ||
function getESGlobalKeys(remapTypedArrays = true) { | ||
function getESGlobalKeys(maxPerfMode: boolean) { | ||
const ESGlobalKeys = [ | ||
// *** 19.1 Value Properties of the Global Object | ||
'globalThis', | ||
|
@@ -91,23 +91,31 @@ function getESGlobalKeys(remapTypedArrays = true) { | |
// 'Intl', // Remapped | ||
]; | ||
|
||
if (remapTypedArrays === false) { | ||
ESGlobalKeys.push( | ||
// This set is for maxPerfMode, all of these must be from the same global object | ||
const maxPerfModeKeys = { | ||
intrinsics: [ | ||
'ArrayBuffer', | ||
'Atomics', | ||
'BigInt64Array', | ||
'BigUint64Array', | ||
'DataView', | ||
'Float32Array', | ||
'Float64Array', | ||
'Int8Array', | ||
'Int16Array', | ||
'Int32Array', | ||
'Int8Array', | ||
'SharedArrayBuffer', | ||
'Uint16Array', | ||
'Uint32Array', | ||
'Uint8Array', | ||
'Uint8ClampedArray', | ||
'Uint16Array', | ||
'Uint32Array' | ||
); | ||
], | ||
// Ideally these should come from browser-realm, that's a code reorg improvement for later | ||
browser: ['Blob', 'crypto', 'Crypto', 'File', 'FileReader', 'SubtleCrypto', 'URL'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works for me, and I agree with your comment 👍 |
||
}; | ||
|
||
if (maxPerfMode) { | ||
ESGlobalKeys.push(...maxPerfModeKeys.intrinsics, ...maxPerfModeKeys.browser); | ||
} | ||
return ESGlobalKeys; | ||
} | ||
|
@@ -131,8 +139,8 @@ const ReflectiveIntrinsicObjectNames = [ | |
'globalThis', | ||
]; | ||
|
||
function getESGlobalsAndReflectiveIntrinsicObjectNames(remapTypedArrays = true) { | ||
const ESGlobalKeys = getESGlobalKeys(remapTypedArrays); | ||
function getESGlobalsAndReflectiveIntrinsicObjectNames(maxPerfMode: boolean) { | ||
const ESGlobalKeys = getESGlobalKeys(maxPerfMode); | ||
return toSafeArray([...ESGlobalKeys, ...ReflectiveIntrinsicObjectNames]); | ||
} | ||
|
||
|
@@ -149,10 +157,10 @@ function getGlobalObjectOwnKeys(source: object): PropertyKey[] { | |
|
||
export function assignFilteredGlobalDescriptorsFromPropertyDescriptorMap< | ||
T extends PropertyDescriptorMap | ||
>(descs: T, source: PropertyDescriptorMap, includeTypedArrays?: boolean): T { | ||
>(descs: T, source: PropertyDescriptorMap, maxPerfMode: boolean): T { | ||
const ownKeys = getGlobalObjectOwnKeys(source); | ||
const ESGlobalsAndReflectiveIntrinsicObjectNames = | ||
getESGlobalsAndReflectiveIntrinsicObjectNames(includeTypedArrays); | ||
getESGlobalsAndReflectiveIntrinsicObjectNames(maxPerfMode); | ||
for (let i = 0, { length } = ownKeys; i < length; i += 1) { | ||
const ownKey = ownKeys[i]; | ||
// Avoid overriding ECMAScript global names that correspond to | ||
|
@@ -172,15 +180,12 @@ export function assignFilteredGlobalDescriptorsFromPropertyDescriptorMap< | |
return descs; | ||
} | ||
|
||
export function getFilteredGlobalOwnKeys( | ||
source: object, | ||
includeTypedArrays?: boolean | ||
): PropertyKey[] { | ||
export function getFilteredGlobalOwnKeys(source: object, maxPerfMode: boolean): PropertyKey[] { | ||
const result: PropertyKey[] = []; | ||
let resultOffset = 0; | ||
const ownKeys = getGlobalObjectOwnKeys(source); | ||
const ESGlobalsAndReflectiveIntrinsicObjectNames = | ||
getESGlobalsAndReflectiveIntrinsicObjectNames(includeTypedArrays); | ||
getESGlobalsAndReflectiveIntrinsicObjectNames(maxPerfMode); | ||
for (let i = 0, { length } = ownKeys; i < length; i += 1) { | ||
const ownKey = ownKeys[i]; | ||
// Avoid overriding ECMAScript global names that correspond to global | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh... looks like the built in VSCode sort is strictly lexicographical 🤮