mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 06:55:06 +02:00
Follow-up to #4165
Added catch to achieve the entire goal of the previous PR to prevent the harness from loading if 'class' syntax isn't supported
This commit is contained in:
parent
18ebac8122
commit
e7d9c0d698
@ -17,11 +17,16 @@ defines:
|
|||||||
- TestIterationAndResize
|
- TestIterationAndResize
|
||||||
features: [BigInt]
|
features: [BigInt]
|
||||||
---*/
|
---*/
|
||||||
|
// Helper to create subclasses without bombing out when `class` isn't supported
|
||||||
|
function subClass(type) {
|
||||||
|
try {
|
||||||
|
return new Function('return class My' + type + ' extends ' + type + ' {}')();
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
// Using new Function()(); instead of just 'class x extends Y' as to not bomb out when `class` isn't supported
|
const MyUint8Array = subClass('Uint8Array');
|
||||||
const MyUint8Array = new Function('return class MyUint8Array extends Uint8Array {}')();
|
const MyFloat32Array = subClass('Float32Array');
|
||||||
const MyFloat32Array = new Function('return class MyFloat32Array extends Float32Array {}')();
|
const MyBigInt64Array = subClass('BigInt64Array');
|
||||||
const MyBigInt64Array = new Function('return class MyBigInt64Array extends BigInt64Array {}')();
|
|
||||||
|
|
||||||
const builtinCtors = [
|
const builtinCtors = [
|
||||||
Uint8Array,
|
Uint8Array,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user