summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/const/syntax
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/language/statements/const/syntax
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/statements/const/syntax')
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-mixed-with-without-initialiser.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-mixed-without-with-initialiser.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-without-initialiser.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/browser.js0
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/const-declaring-let-split-across-two-lines.js20
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-next-expression-for.js13
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-statement-body-for-in.js13
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-statement-body-for-of.js13
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/const-outer-inner-let-bindings.js24
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/const.js23
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/shell.js0
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/with-initializer-case-expression-statement-list.js11
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/with-initializer-default-statement-list.js11
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/with-initializer-do-statement-while-expression.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/with-initializer-for-statement.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/with-initializer-if-expression-statement-else-statement.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/with-initializer-if-expression-statement.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/with-initializer-label-statement.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/with-initializer-while-expression-statement.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/without-initializer-case-expression-statement-list.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/without-initializer-default-statement-list.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/without-initializer-do-statement-while-expression.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/without-initializer-for-statement.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/without-initializer-if-expression-statement-else-statement.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/without-initializer-if-expression-statement.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/without-initializer-label-statement.js15
-rw-r--r--js/src/tests/test262/language/statements/const/syntax/without-initializer-while-expression-statement.js15
27 files changed, 383 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-mixed-with-without-initialiser.js b/js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-mixed-with-without-initialiser.js
new file mode 100644
index 0000000000..a8fd7d4631
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-mixed-with-without-initialiser.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations mixed: with, without initialiser
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+const x = 1, y;
+
diff --git a/js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-mixed-without-with-initialiser.js b/js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-mixed-without-with-initialiser.js
new file mode 100644
index 0000000000..7d4840678c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-mixed-without-with-initialiser.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations mixed: without, with initialiser
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+const x, y = 1;
+
diff --git a/js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-without-initialiser.js b/js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-without-initialiser.js
new file mode 100644
index 0000000000..ca9d9b24b5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/block-scope-syntax-const-declarations-without-initialiser.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations without initialiser
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+const x;
+
diff --git a/js/src/tests/test262/language/statements/const/syntax/browser.js b/js/src/tests/test262/language/statements/const/syntax/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/browser.js
diff --git a/js/src/tests/test262/language/statements/const/syntax/const-declaring-let-split-across-two-lines.js b/js/src/tests/test262/language/statements/const/syntax/const-declaring-let-split-across-two-lines.js
new file mode 100644
index 0000000000..c5d571e713
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/const-declaring-let-split-across-two-lines.js
@@ -0,0 +1,20 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2015 Mozilla Corporation. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+author: Jeff Walden
+es6id: 13.3.1.1
+description: >
+ const: |const let| split across two lines is a static semantics early error.
+info: |
+ Lexical declarations may not declare a binding named "let".
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+const
+let = "irrelevant initializer";
diff --git a/js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-next-expression-for.js b/js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-next-expression-for.js
new file mode 100644
index 0000000000..a48a261239
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-next-expression-for.js
@@ -0,0 +1,13 @@
+// Copyright (C) 2015 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.6.3.7_S5.a.i
+description: >
+ const: invalid assignment in next expression
+---*/
+
+assert.throws(TypeError, function() {
+ for (const i = 0; i < 1; i++) {}
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-statement-body-for-in.js b/js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-statement-body-for-in.js
new file mode 100644
index 0000000000..3c2c66c4c7
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-statement-body-for-in.js
@@ -0,0 +1,13 @@
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.6.4.10_S1.a.i
+description: >
+ const: invalid assignment in Statement body
+---*/
+
+assert.throws(TypeError, function() {
+ for (const x in [1, 2, 3]) { x++ }
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-statement-body-for-of.js b/js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-statement-body-for-of.js
new file mode 100644
index 0000000000..a0c6ae502c
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/const-invalid-assignment-statement-body-for-of.js
@@ -0,0 +1,13 @@
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.6.4.10_S1.a.i
+description: >
+ const: invalid assignment in Statement body
+---*/
+
+assert.throws(TypeError, function() {
+ for (const x of [1, 2, 3]) { x++ }
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/const/syntax/const-outer-inner-let-bindings.js b/js/src/tests/test262/language/statements/const/syntax/const-outer-inner-let-bindings.js
new file mode 100644
index 0000000000..eaa85ea045
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/const-outer-inner-let-bindings.js
@@ -0,0 +1,24 @@
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ outer const binding unchanged by for-loop const binding
+---*/
+//
+
+const x = "outer_x";
+const y = "outer_y";
+var i = 0;
+
+for (const x = "inner_x"; i < 1; i++) {
+ const y = "inner_y";
+
+ assert.sameValue(x, "inner_x");
+ assert.sameValue(y, "inner_y");
+}
+assert.sameValue(x, "outer_x");
+assert.sameValue(y, "outer_y");
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/const/syntax/const.js b/js/src/tests/test262/language/statements/const/syntax/const.js
new file mode 100644
index 0000000000..0727dea9fb
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/const.js
@@ -0,0 +1,23 @@
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ global and block scope const
+---*/
+const z = 4;
+
+// Block local
+{
+ const z = 5;
+}
+
+assert.sameValue(z, 4);
+
+if (true) {
+ const z = 1;
+ assert.sameValue(z, 1);
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/const/syntax/shell.js b/js/src/tests/test262/language/statements/const/syntax/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/shell.js
diff --git a/js/src/tests/test262/language/statements/const/syntax/with-initializer-case-expression-statement-list.js b/js/src/tests/test262/language/statements/const/syntax/with-initializer-case-expression-statement-list.js
new file mode 100644
index 0000000000..ebf239f7b5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/with-initializer-case-expression-statement-list.js
@@ -0,0 +1,11 @@
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations with initialisers in statement positions:
+ case Expression : StatementList
+---*/
+switch (true) { case true: const x = 1; }
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/const/syntax/with-initializer-default-statement-list.js b/js/src/tests/test262/language/statements/const/syntax/with-initializer-default-statement-list.js
new file mode 100644
index 0000000000..2b2790c84b
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/with-initializer-default-statement-list.js
@@ -0,0 +1,11 @@
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations with initialisers in statement positions:
+ default : StatementList
+---*/
+switch (true) { default: const x = 1; }
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/statements/const/syntax/with-initializer-do-statement-while-expression.js b/js/src/tests/test262/language/statements/const/syntax/with-initializer-do-statement-while-expression.js
new file mode 100644
index 0000000000..a2f30531b2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/with-initializer-do-statement-while-expression.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations with initialisers in statement positions:
+ do Statement while ( Expression )
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+do const x = 1; while (false)
diff --git a/js/src/tests/test262/language/statements/const/syntax/with-initializer-for-statement.js b/js/src/tests/test262/language/statements/const/syntax/with-initializer-for-statement.js
new file mode 100644
index 0000000000..82e437428a
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/with-initializer-for-statement.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations with initialisers in statement positions:
+ for ( ;;) Statement
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+for (;false;) const x = 1;
diff --git a/js/src/tests/test262/language/statements/const/syntax/with-initializer-if-expression-statement-else-statement.js b/js/src/tests/test262/language/statements/const/syntax/with-initializer-if-expression-statement-else-statement.js
new file mode 100644
index 0000000000..1153ecae41
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/with-initializer-if-expression-statement-else-statement.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations with initialisers in statement positions:
+ if ( Expression ) Statement else Statement
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+if (true) {} else const x = 1;
diff --git a/js/src/tests/test262/language/statements/const/syntax/with-initializer-if-expression-statement.js b/js/src/tests/test262/language/statements/const/syntax/with-initializer-if-expression-statement.js
new file mode 100644
index 0000000000..578b84f316
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/with-initializer-if-expression-statement.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations with initialisers in statement positions:
+ if ( Expression ) Statement
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+if (true) const x = 1;
diff --git a/js/src/tests/test262/language/statements/const/syntax/with-initializer-label-statement.js b/js/src/tests/test262/language/statements/const/syntax/with-initializer-label-statement.js
new file mode 100644
index 0000000000..2bd15c778f
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/with-initializer-label-statement.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations with initialisers in statement positions:
+ label: Statement
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+label: const x = 1;
diff --git a/js/src/tests/test262/language/statements/const/syntax/with-initializer-while-expression-statement.js b/js/src/tests/test262/language/statements/const/syntax/with-initializer-while-expression-statement.js
new file mode 100644
index 0000000000..4c9d9e6827
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/with-initializer-while-expression-statement.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations with initialisers in statement positions:
+ while ( Expression ) Statement
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+while (false) const x = 1;
diff --git a/js/src/tests/test262/language/statements/const/syntax/without-initializer-case-expression-statement-list.js b/js/src/tests/test262/language/statements/const/syntax/without-initializer-case-expression-statement-list.js
new file mode 100644
index 0000000000..e8c367c32e
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/without-initializer-case-expression-statement-list.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations without initialisers in statement positions:
+ case Expression : StatementList
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+switch (true) { case true: const x; }
diff --git a/js/src/tests/test262/language/statements/const/syntax/without-initializer-default-statement-list.js b/js/src/tests/test262/language/statements/const/syntax/without-initializer-default-statement-list.js
new file mode 100644
index 0000000000..ff8f429de4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/without-initializer-default-statement-list.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations without initialisers in statement positions:
+ default : StatementList
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+switch (true) { default: const x; }
diff --git a/js/src/tests/test262/language/statements/const/syntax/without-initializer-do-statement-while-expression.js b/js/src/tests/test262/language/statements/const/syntax/without-initializer-do-statement-while-expression.js
new file mode 100644
index 0000000000..6e3a086964
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/without-initializer-do-statement-while-expression.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations without initialisers in statement positions:
+ do Statement while ( Expression )
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+do const x; while (false)
diff --git a/js/src/tests/test262/language/statements/const/syntax/without-initializer-for-statement.js b/js/src/tests/test262/language/statements/const/syntax/without-initializer-for-statement.js
new file mode 100644
index 0000000000..2a7c84ccc2
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/without-initializer-for-statement.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations without initialisers in statement positions:
+ for ( ;;) Statement
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+for (;false;) const x;
diff --git a/js/src/tests/test262/language/statements/const/syntax/without-initializer-if-expression-statement-else-statement.js b/js/src/tests/test262/language/statements/const/syntax/without-initializer-if-expression-statement-else-statement.js
new file mode 100644
index 0000000000..1a5e3d1a67
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/without-initializer-if-expression-statement-else-statement.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations without initialisers in statement positions:
+ if ( Expression ) Statement else Statement
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+if (true) {} else const x;
diff --git a/js/src/tests/test262/language/statements/const/syntax/without-initializer-if-expression-statement.js b/js/src/tests/test262/language/statements/const/syntax/without-initializer-if-expression-statement.js
new file mode 100644
index 0000000000..4d894bbe11
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/without-initializer-if-expression-statement.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations without initialisers in statement positions:
+ if ( Expression ) Statement
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+if (true) const x;
diff --git a/js/src/tests/test262/language/statements/const/syntax/without-initializer-label-statement.js b/js/src/tests/test262/language/statements/const/syntax/without-initializer-label-statement.js
new file mode 100644
index 0000000000..a3b71f12f4
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/without-initializer-label-statement.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations without initialisers in statement positions:
+ label: Statement
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+label: const x;
diff --git a/js/src/tests/test262/language/statements/const/syntax/without-initializer-while-expression-statement.js b/js/src/tests/test262/language/statements/const/syntax/without-initializer-while-expression-statement.js
new file mode 100644
index 0000000000..31aea3f9a5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/const/syntax/without-initializer-while-expression-statement.js
@@ -0,0 +1,15 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2011 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 13.1
+description: >
+ const declarations without initialisers in statement positions:
+ while ( Expression ) Statement
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+while (false) const x;