2017-04-11 22:31:35 +02:00
|
|
|
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
author: Jeff Walden <jwalden+code@mit.edu>
|
|
|
|
esid: sec-let-and-const-declarations
|
|
|
|
description: >
|
2017-06-30 16:26:50 +02:00
|
|
|
`let yield` does not permit ASI in between, as `yield` is a BindingIdentifier
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2017-06-30 16:26:50 +02:00
|
|
|
`yield` is a perfectly cromulent binding name in any context grammatically, just
|
2017-04-11 22:31:35 +02:00
|
|
|
prohibited by static semantics in some contexts. Therefore ASI can never apply
|
2017-06-30 16:26:50 +02:00
|
|
|
between `let` (where a LexicalDeclaration is permitted) and `yield`,
|
2017-04-11 22:31:35 +02:00
|
|
|
so a subsequent `0` where `=` was expected is a syntax error.
|
|
|
|
negative:
|
2017-12-03 06:06:42 +01:00
|
|
|
phase: parse
|
2017-04-11 22:31:35 +02:00
|
|
|
type: SyntaxError
|
2017-10-26 23:05:18 +02:00
|
|
|
features: [generators]
|
2017-04-11 22:31:35 +02:00
|
|
|
---*/
|
|
|
|
|
2018-10-11 16:59:24 +02:00
|
|
|
$DONOTEVALUATE();
|
2017-04-29 22:31:08 +02:00
|
|
|
|
2017-06-30 16:26:50 +02:00
|
|
|
function* f() {
|
2017-04-11 22:31:35 +02:00
|
|
|
let
|
2017-06-30 16:26:50 +02:00
|
|
|
yield 0;
|
2017-04-11 22:31:35 +02:00
|
|
|
}
|