mirror of
https://github.com/tc39/test262.git
synced 2025-09-25 19:18:48 +02:00
Enable strict mode testing for sm/JSON/parse-with-source.js
This commit is contained in:
parent
15be7166d5
commit
0ee9b57cba
@ -3,8 +3,6 @@
|
||||
|
||||
/*---
|
||||
includes: [compareArray.js]
|
||||
flags:
|
||||
- noStrict
|
||||
description: |
|
||||
pending
|
||||
esid: pending
|
||||
@ -121,11 +119,12 @@ features: [json-parse-with-source]
|
||||
assert.sameValue(obj.rawJSON, "false");
|
||||
})();
|
||||
|
||||
(function checkErrorsComeFromCorrectRealm() {
|
||||
// Check errors come from correct realm.
|
||||
{
|
||||
const otherGlobal = $262.createRealm().global;
|
||||
assert.sameValue(TypeError !== otherGlobal.TypeError, true);
|
||||
|
||||
assertErrorComesFromCorrectRealm = (fun, thisRealmType) => {
|
||||
let assertErrorComesFromCorrectRealm = (fun, thisRealmType) => {
|
||||
assert.throws(thisRealmType, () => fun(this),
|
||||
`${thisRealmType.name} should come from this realm.`);
|
||||
assert.throws(otherGlobal[thisRealmType.name], () => fun(otherGlobal),
|
||||
@ -142,5 +141,4 @@ features: [json-parse-with-source]
|
||||
assertErrorComesFromCorrectRealm((gbl) => gbl.JSON.rawJSON('123\n'), SyntaxError);
|
||||
assertErrorComesFromCorrectRealm((gbl) => gbl.JSON.rawJSON('\t123'), SyntaxError);
|
||||
assertErrorComesFromCorrectRealm((gbl) => gbl.JSON.rawJSON(''), SyntaxError);
|
||||
})();
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user