| // http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors |
| // If the "yield" label is used under the sloppy mode and the context is not |
| // a generator context, we can use "yield" as a label. |
| yield: for (var i = 0; i < 1000; ++i) { |
| yield: for (var i = 0; i < 1000; ++i) { |
| function testSyntaxError(script, message) { |
| throw new Error("Expected syntax error not thrown"); |
| if (String(error) !== message) |
| throw new Error("Bad error: " + String(error)); |
| yield: for (var i = 0; i < 1000; ++i) { |
| `, `SyntaxError: Unexpected keyword 'yield'. Expected an identifier as the target for a break statement.`); |
| yield: for (var i = 0; i < 1000; ++i) { |
| `, `SyntaxError: Unexpected keyword 'yield'. Expected an identifier as the target for a continue statement.`) |