Rename non262-shell.js and remove no longer used non262.js

This commit is contained in:
André Bargull 2025-04-30 14:16:09 +02:00 committed by Philip Chimento
parent 5853b56f6e
commit 76cd14cf50
28 changed files with 49 additions and 113 deletions

View File

@ -0,0 +1,24 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*---
defines: [assertThrowsValue]
---*/
function assertThrowsValue(f, val, msg) {
try {
f();
} catch (exc) {
assert.sameValue(exc, val, msg);
return;
}
var fullmsg = "Assertion failed: expected exception, no exception thrown";
if (msg !== void 0) {
fullmsg += " - " + msg;
}
throw new Test262Error(fullmsg);
}

View File

@ -1,32 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*---
defines: [assertThrowsValue]
allow_unused: True
---*/
(function() {
const undefined = void 0;
if (typeof globalThis.assertThrowsValue === 'undefined') {
globalThis.assertThrowsValue = function assertThrowsValue(f, val, msg) {
var fullmsg;
try {
f();
} catch (exc) {
if ((exc === val) === (val === val) && (val !== 0 || 1 / exc === 1 / val))
return;
fullmsg = "Assertion failed: expected exception " + val + ", got " + exc;
}
if (fullmsg === undefined)
fullmsg = "Assertion failed: expected exception " + val + ", no exception thrown";
if (msg !== undefined)
fullmsg += " - " + msg;
throw new Error(fullmsg);
};
}
})();

View File

@ -1,56 +0,0 @@
/*---
defines: [assertThrownErrorContains, assertThrowsInstanceOfWithMessageCheck, newGlobal, print, assertEq, reportCompare, createIsHTMLDDA, createExternalArrayBuffer]
---*/
function assertThrownErrorContains(f, substr) {
try {
f();
} catch (exc) {
// Do not test error messages
return;
}
throw new Test262Error("Expected error containing " + substr + ", no exception thrown");
}
function assertThrowsInstanceOfWithMessageCheck(f, ctor, _check, msg) {
var fullmsg;
try {
f();
} catch (exc) {
if (exc instanceof ctor)
return;
fullmsg = `Assertion failed: expected exception ${ctor.name}, got ${exc}`;
}
if (fullmsg === undefined)
fullmsg = `Assertion failed: expected exception ${ctor.name}, no exception thrown`;
if (msg !== undefined)
fullmsg += " - " + msg;
throw new Error(fullmsg);
}
globalThis.createNewGlobal = function() {
return $262.createRealm().global
}
function print(...args) {
}
function assertEq(...args) {
assert.sameValue(...args)
}
function reportCompare(...args) {
assert.sameValue(...args)
}
if (globalThis.createIsHTMLDDA === undefined) {
globalThis.createIsHTMLDDA = function createIsHTMLDDA() {
return $262.IsHTMLDDA;
}
}
if (globalThis.createExternalArrayBuffer === undefined) {
globalThis.createExternalArrayBuffer = function createExternalArrayBuffer(size) {
return new ArrayBuffer(size);
}
}

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js, deepEqual.js]
includes: [sm/assertThrowsValue.js, deepEqual.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js, sm/non262-Reflect-shell.js, compareArray.js]
includes: [sm/assertThrowsValue.js, sm/non262-Reflect-shell.js, compareArray.js]
flags:
- noStrict
description: |

View File

@ -6,7 +6,7 @@
/*---
features:
- IsHTMLDDA
includes: [sm/non262-shell.js, sm/non262-Reflect-shell.js, deepEqual.js]
includes: [sm/assertThrowsValue.js, sm/non262-Reflect-shell.js, deepEqual.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js, deepEqual.js]
includes: [sm/assertThrowsValue.js, deepEqual.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js, compareArray.js, deepEqual.js]
includes: [sm/assertThrowsValue.js, compareArray.js, deepEqual.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js, sm/non262-Reflect-shell.js, deepEqual.js]
includes: [sm/assertThrowsValue.js, sm/non262-Reflect-shell.js, deepEqual.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262-shell.js, sm/non262-TypedArray-shell.js, deepEqual.js]
includes: [sm/assertThrowsValue.js, sm/non262-TypedArray-shell.js, deepEqual.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -4,7 +4,7 @@
*/
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262-shell.js, sm/non262-generators-shell.js]
includes: [sm/assertThrowsValue.js, sm/non262-generators-shell.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |

View File

@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
includes: [sm/non262-shell.js]
includes: [sm/assertThrowsValue.js]
flags:
- noStrict
description: |