Add ASI let/yield test (#1084)

I had previously intended to add this test in
https://github.com/tc39/test262/pull/968 ,
but it seems like I instead checked in a copy of another test. This
patch changes it to test what was initially intended, which is part of
the semantics for https://github.com/tc39/ecma262/pull/885
This commit is contained in:
Daniel Ehrenberg 2017-06-30 16:26:50 +02:00 committed by Leo Balter
parent 3894e1fd13
commit 193779ee0c
1 changed files with 5 additions and 5 deletions

View File

@ -5,11 +5,11 @@
author: Jeff Walden <jwalden+code@mit.edu> author: Jeff Walden <jwalden+code@mit.edu>
esid: sec-let-and-const-declarations esid: sec-let-and-const-declarations
description: > description: >
`let await` does not permit ASI in between, as `await` is a BindingIdentifier `let yield` does not permit ASI in between, as `yield` is a BindingIdentifier
info: > info: >
`await` is a perfectly cromulent binding name in any context grammatically, just `yield` is a perfectly cromulent binding name in any context grammatically, just
prohibited by static semantics in some contexts. Therefore ASI can never apply prohibited by static semantics in some contexts. Therefore ASI can never apply
between `let` (where a LexicalDeclaration is permitted) and `await`, between `let` (where a LexicalDeclaration is permitted) and `yield`,
so a subsequent `0` where `=` was expected is a syntax error. so a subsequent `0` where `=` was expected is a syntax error.
negative: negative:
phase: early phase: early
@ -18,7 +18,7 @@ negative:
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";
async function f() { function* f() {
let let
await 0; yield 0;
} }