diff --git a/test/staging/sm/JSON/parse-with-source.js b/test/staging/sm/JSON/parse-with-source.js index ddcf0130b5..32869059dd 100644 --- a/test/staging/sm/JSON/parse-with-source.js +++ b/test/staging/sm/JSON/parse-with-source.js @@ -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); -})(); - +}