From a216e703d1b4d38f09402fe7b7104ddf9cbf7383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 30 Apr 2025 14:16:34 +0200 Subject: [PATCH] Enable strict mode testing for sm/misc --- test/staging/sm/misc/bug1126318.js | 9 ++++----- .../misc/builtin-methods-reject-null-undefined-this.js | 2 -- test/staging/sm/misc/enumerate-undefined.js | 2 -- test/staging/sm/misc/error-undefined-message.js | 2 -- .../sm/misc/explicit-undefined-optional-argument.js | 2 -- test/staging/sm/misc/getter-setter-outerize-this.js | 6 ++---- .../line-paragraph-separator-parse-as-lineterminator.js | 2 -- test/staging/sm/misc/new-with-non-constructor.js | 2 -- .../sm/misc/redeclare-var-non-writable-property.js | 2 -- test/staging/sm/misc/regexp-functions-with-undefined.js | 2 -- .../staging/sm/misc/syntax-error-end-of-for-head-part.js | 2 -- test/staging/sm/misc/unicode-escaped-keyword.js | 2 -- test/staging/sm/misc/unicode-identifier-1d17.js | 2 -- test/staging/sm/misc/unicode-identifier-82f1.js | 2 -- test/staging/sm/misc/unwrapped-no-such-method.js | 2 -- 15 files changed, 6 insertions(+), 35 deletions(-) diff --git a/test/staging/sm/misc/bug1126318.js b/test/staging/sm/misc/bug1126318.js index 4b64850f9d..c38ed8a863 100644 --- a/test/staging/sm/misc/bug1126318.js +++ b/test/staging/sm/misc/bug1126318.js @@ -2,14 +2,14 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -flags: - - noStrict description: | pending esid: pending ---*/ -if (typeof window === "undefined") - window = this; + +if (typeof window === "undefined") { + var window = this; +} Object.defineProperty(window, "foo", { get: function() { return 5; }, @@ -18,4 +18,3 @@ Object.defineProperty(window, "foo", { for (var i = 0; i < 100; ++i) assert.sameValue(window.foo, 5); - diff --git a/test/staging/sm/misc/builtin-methods-reject-null-undefined-this.js b/test/staging/sm/misc/builtin-methods-reject-null-undefined-this.js index 0c8a9a2b3a..3cc099e1ef 100644 --- a/test/staging/sm/misc/builtin-methods-reject-null-undefined-this.js +++ b/test/staging/sm/misc/builtin-methods-reject-null-undefined-this.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | ECMAScript built-in methods that immediately throw when |this| is |undefined| or |null| (due to CheckObjectCoercible, ToObject, or ToString) esid: pending diff --git a/test/staging/sm/misc/enumerate-undefined.js b/test/staging/sm/misc/enumerate-undefined.js index 5f14958b14..e1ef04db45 100644 --- a/test/staging/sm/misc/enumerate-undefined.js +++ b/test/staging/sm/misc/enumerate-undefined.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | JS_EnumerateStandardClasses uses wrong attributes for undefined esid: pending diff --git a/test/staging/sm/misc/error-undefined-message.js b/test/staging/sm/misc/error-undefined-message.js index e22c0b10b7..41292a1442 100644 --- a/test/staging/sm/misc/error-undefined-message.js +++ b/test/staging/sm/misc/error-undefined-message.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | pending esid: pending diff --git a/test/staging/sm/misc/explicit-undefined-optional-argument.js b/test/staging/sm/misc/explicit-undefined-optional-argument.js index 545b6f6337..4c23959b15 100644 --- a/test/staging/sm/misc/explicit-undefined-optional-argument.js +++ b/test/staging/sm/misc/explicit-undefined-optional-argument.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | Properly handle explicitly-undefined optional arguments to a bunch of functions esid: pending diff --git a/test/staging/sm/misc/getter-setter-outerize-this.js b/test/staging/sm/misc/getter-setter-outerize-this.js index 16c28d6f2d..57178a478b 100644 --- a/test/staging/sm/misc/getter-setter-outerize-this.js +++ b/test/staging/sm/misc/getter-setter-outerize-this.js @@ -2,17 +2,16 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -flags: - - noStrict description: | pending esid: pending ---*/ + if (typeof window === "undefined") { // This test is meant to run in the browser, but it's easy to // run it in the shell as well, even though it has no inner/outer // windows. - window = this; + var window = this; } var res = false; @@ -27,4 +26,3 @@ Object.defineProperty(this, "foo", {configurable: true, assert.sameValue(window.foo, true, "getter"); } })(); - diff --git a/test/staging/sm/misc/line-paragraph-separator-parse-as-lineterminator.js b/test/staging/sm/misc/line-paragraph-separator-parse-as-lineterminator.js index e55a32cf27..e593adb43b 100644 --- a/test/staging/sm/misc/line-paragraph-separator-parse-as-lineterminator.js +++ b/test/staging/sm/misc/line-paragraph-separator-parse-as-lineterminator.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR must match the LineTerminator production when parsing code esid: pending diff --git a/test/staging/sm/misc/new-with-non-constructor.js b/test/staging/sm/misc/new-with-non-constructor.js index 20a78c8992..56ecdc1586 100644 --- a/test/staging/sm/misc/new-with-non-constructor.js +++ b/test/staging/sm/misc/new-with-non-constructor.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | pending esid: pending diff --git a/test/staging/sm/misc/redeclare-var-non-writable-property.js b/test/staging/sm/misc/redeclare-var-non-writable-property.js index efbcea6e66..acd213aa1b 100644 --- a/test/staging/sm/misc/redeclare-var-non-writable-property.js +++ b/test/staging/sm/misc/redeclare-var-non-writable-property.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | |var| statements for existing, read-only/permanent properties should not be errors esid: pending diff --git a/test/staging/sm/misc/regexp-functions-with-undefined.js b/test/staging/sm/misc/regexp-functions-with-undefined.js index 80c4409346..6dd2f5b5fa 100644 --- a/test/staging/sm/misc/regexp-functions-with-undefined.js +++ b/test/staging/sm/misc/regexp-functions-with-undefined.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | pending esid: pending diff --git a/test/staging/sm/misc/syntax-error-end-of-for-head-part.js b/test/staging/sm/misc/syntax-error-end-of-for-head-part.js index 3fbf89888d..870928c1f3 100644 --- a/test/staging/sm/misc/syntax-error-end-of-for-head-part.js +++ b/test/staging/sm/misc/syntax-error-end-of-for-head-part.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | Syntax errors at the end of |for| statement header parts shouldn't cause crashes esid: pending diff --git a/test/staging/sm/misc/unicode-escaped-keyword.js b/test/staging/sm/misc/unicode-escaped-keyword.js index 07a5aca0a3..7cf32e5f1f 100644 --- a/test/staging/sm/misc/unicode-escaped-keyword.js +++ b/test/staging/sm/misc/unicode-escaped-keyword.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | pending esid: pending diff --git a/test/staging/sm/misc/unicode-identifier-1d17.js b/test/staging/sm/misc/unicode-identifier-1d17.js index 2e9fcb396f..d2f2e7bad3 100644 --- a/test/staging/sm/misc/unicode-identifier-1d17.js +++ b/test/staging/sm/misc/unicode-identifier-1d17.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | pending esid: pending diff --git a/test/staging/sm/misc/unicode-identifier-82f1.js b/test/staging/sm/misc/unicode-identifier-82f1.js index 483d2b4cbb..86c67635fa 100644 --- a/test/staging/sm/misc/unicode-identifier-82f1.js +++ b/test/staging/sm/misc/unicode-identifier-82f1.js @@ -4,8 +4,6 @@ */ /*--- -flags: - - noStrict description: | pending esid: pending diff --git a/test/staging/sm/misc/unwrapped-no-such-method.js b/test/staging/sm/misc/unwrapped-no-such-method.js index a536ca0d07..f3496518ce 100644 --- a/test/staging/sm/misc/unwrapped-no-such-method.js +++ b/test/staging/sm/misc/unwrapped-no-such-method.js @@ -2,8 +2,6 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -flags: - - noStrict description: | pending esid: pending