/* Strip a current engine down to ECMAScript 5 and typed arrays, so that one fast engine can * stand in for the oldest engines the J rung serves. Loaded by conformance.js with * `--strip es5`, after Node's own modules (which keep the builtins they captured at * start-up). The deleted names are listed in global.__WAI_ES5_STRIPPED. Modern syntax * is fine here: this file runs only on a modern Node. */ 'use strict'; const g = globalThis, out = []; const SYM_IT = Symbol.iterator; function del(obj, name, label) { if (obj && Object.prototype.hasOwnProperty.call(obj, name)) { try { delete obj[name]; out.push(label || String(name)); } catch (e) { /* not configurable */ } } } for (const k of ['WebAssembly', 'BigInt', 'BigInt64Array', 'BigUint64Array', 'Map', 'Set', 'WeakMap', 'WeakSet', 'WeakRef', 'FinalizationRegistry', 'Reflect', 'Proxy', 'TextEncoder', 'TextDecoder', 'Symbol', 'Promise']) del(g, k); for (const k of ['imul', 'fround', 'clz32', 'trunc', 'sign', 'log2', 'log10', 'cbrt', 'hypot', 'expm1', 'log1p']) del(Math, k, 'Math.' + k); for (const k of ['isSafeInteger', 'isInteger', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'EPSILON', 'MAX_SAFE_INTEGER', 'MIN_SAFE_INTEGER']) del(Number, k, 'Number.' + k); for (const k of ['entries', 'values', 'assign', 'is', 'getOwnPropertySymbols', 'setPrototypeOf', 'fromEntries']) del(Object, k, 'Object.' + k); for (const k of ['from', 'of']) del(Array, k, 'Array.' + k); for (const k of ['fill', 'find', 'findIndex', 'findLast', 'findLastIndex', 'includes', 'keys', 'values', 'entries', 'copyWithin', 'flat', 'flatMap', 'at']) del(Array.prototype, k, 'Array.prototype.' + k); for (const k of ['startsWith', 'endsWith', 'includes', 'repeat', 'padStart', 'padEnd', 'codePointAt', 'normalize', 'at', 'trimStart', 'trimEnd', 'replaceAll', 'matchAll']) del(String.prototype, k, 'String.prototype.' + k); del(String, 'fromCodePoint', 'String.fromCodePoint'); const TA = Object.getPrototypeOf(Uint8Array.prototype); for (const k of ['slice', 'fill', 'find', 'findIndex', 'includes', 'indexOf', 'lastIndexOf', 'join', 'forEach', 'map', 'filter', 'reduce', 'reduceRight', 'some', 'every', 'sort', 'reverse', 'keys', 'values', 'entries', 'copyWithin', 'at', 'toString']) del(TA, k, 'TypedArray.prototype.' + k); del(TA, SYM_IT, 'TypedArray.prototype[Symbol.iterator]'); del(Array.prototype, SYM_IT, 'Array.prototype[Symbol.iterator]'); del(DataView.prototype, 'getBigInt64', 'DataView.prototype.getBigInt64'); del(DataView.prototype, 'setBigInt64', 'DataView.prototype.setBigInt64'); // An early typed-array quirk: slice() returns a view, not a copy. Object.defineProperty(TA, 'slice', { configurable: true, writable: true, value: function (b, e) { return this.subarray(b, e); } }); out.push('TypedArray.prototype.slice := subarray (a view, as on early engines)'); g.__WAI_ES5_STRIPPED = out;