summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/try/early-catch-function.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/statements/try/early-catch-function.js')
-rw-r--r--js/src/tests/test262/language/statements/try/early-catch-function.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/statements/try/early-catch-function.js b/js/src/tests/test262/language/statements/try/early-catch-function.js
new file mode 100644
index 0000000000..30e53c80b5
--- /dev/null
+++ b/js/src/tests/test262/language/statements/try/early-catch-function.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-try-statement-static-semantics-early-errors
+description: >
+ Redeclaration of CatchParameter with directly nested FunctionDeclaration in function context.
+info: |
+ 13.15.1 Static Semantics: Early Errors
+
+ It is a Syntax Error if any element of the BoundNames of CatchParameter also
+ occurs in the LexicallyDeclaredNames of Block.
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+
+$DONOTEVALUATE();
+
+function f() {
+ try {
+ } catch (e) {
+ function e(){}
+ }
+}