From a08fdc081c1e7f7252aca8a0249791560db60de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Wed, 30 Apr 2025 14:16:18 +0200 Subject: [PATCH] Remove test which checks if unsupported class fields don't crash --- test/staging/sm/fields/unimplemented.js | 65 ------------------------- 1 file changed, 65 deletions(-) delete mode 100644 test/staging/sm/fields/unimplemented.js diff --git a/test/staging/sm/fields/unimplemented.js b/test/staging/sm/fields/unimplemented.js deleted file mode 100644 index 2d1ca5215f..0000000000 --- a/test/staging/sm/fields/unimplemented.js +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) 2024 Mozilla Corporation. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -flags: - - noStrict -description: | - pending -esid: pending ----*/ -// Field syntax doesn't crash the engine when fields are disabled. - -// Are fields enabled? -let fieldsEnabled = false; -try { - Function("class C { x; }"); - fieldsEnabled = true; -} catch (exc) { - assert.sameValue(exc instanceof SyntaxError, true); -} - -// If not, run these tests. (Many other tests cover actual behavior of the -// feature when enabled.) -if (!fieldsEnabled) { - let source = `class C { - x - }`; - assert.throws(SyntaxError, () => Function(source)); - - source = `class C { - x = 0; - }`; - assert.throws(SyntaxError, () => Function(source)); - - source = `class C { - 0 = 0; - }`; - assert.throws(SyntaxError, () => Function(source)); - - source = `class C { - [0] = 0; - }`; - assert.throws(SyntaxError, () => Function(source)); - - source = `class C { - "hi" = 0; - }`; - assert.throws(SyntaxError, () => Function(source)); - - source = `class C { - "hi" = 0; - }`; - assert.throws(SyntaxError, () => Function(source)); - - source = `class C { - d = function(){}; - }`; - assert.throws(SyntaxError, () => Function(source)); - - source = `class C { - d = class D { x = 0; }; - }`; - assert.throws(SyntaxError, () => Function(source)); -} -