Debian Codegraph @

js/src/tests/test262/language/statements/generators/use-strict-with-non-simple-param.js

raw
1 // |reftest| error:SyntaxError
2 // Copyright (C) 2015 André Bargull. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-generator-function-definitions-static-semantics-early-errors
7 description: >
8 A SyntaxError is thrown if a generator contains a non-simple parameter list and a UseStrict directive.
9 info: |
10 Static Semantics: Early Errors
11
12 It is a Syntax Error if ContainsUseStrict of GeneratorBody is true and IsSimpleParameterList of FormalParameters is false.
13 negative:
14 phase: parse
15 type: SyntaxError
16 features: [generators]
17 ---*/
18
19 $DONOTEVALUATE();
20
21 function* f(a = 0) {
22 "use strict";
23 }