New issue
Advanced search Search tips

Issue 4767 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
HW: ----
NextAction: ----
OS: ----
Priority: 2
Type: Bug

Blocking:
issue 1569



Sign in to add a comment

Keyword Incorrectly Permitted in Module Code

Reported by m...@mikepennisi.com, Feb 19 2016

Issue description

When parsing source text as module code, V8 does not restrict the use of the
`await` token as an identifier:

    $ cat m.js
    var await;
    $ d8 --module m.js 
    $ echo $?
    0

Expected: SyntaxError

From http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words:

> 11.6.2.2 Future Reserved Words
> 
> The following tokens are reserved for used as keywords in future language
> extensions.
>
> Syntax
>
>     FutureReservedWord ::
>         enum
>         await
> 
> await is only treated as a FutureReservedWord when Module is the goal symbol
> of the syntactic grammar.

It's not fair to call this a "bug" because module support is still under
development, but I thought it would be good to call out early.

Version: 0835ed9caf44427755065eb45f9187678ec9844c (Mon Feb 15 11:16:09 2016 -0800)
OS: Ubuntu Linux
Architecture: x64
 

Comment 1 by adamk@chromium.org, Feb 19 2016

Blocking: 1569
Components: Language
Labels: Type-Bug Priority-Medium
Owner: adamk@chromium.org
Status: Assigned (was: Untriaged)
Thanks for the report!

Comment 2 by habl...@google.com, Feb 20 2016

Labels: Harmony
Project Member

Comment 3 by bugdroid1@chromium.org, Apr 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/efe5b72d021f4b099e445bf1118b71df065d6e8c

commit efe5b72d021f4b099e445bf1118b71df065d6e8c
Author: mike <mike@mikepennisi.com>
Date: Fri Apr 29 18:12:57 2016

[parser] Enforce module-specific identifier restriction

Restrict the use of the `await` token as an identifier when parsing
source text as module code.

From
http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words:

> 11.6.2.2 Future Reserved Words
>
> The following tokens are reserved for used as keywords in future
> language extensions.
>
> Syntax
>
>     FutureReservedWord ::
>         enum
>         await
>
> await is only treated as a FutureReservedWord when Module is the goal
> symbol of the syntactic grammar.

BUG= v8:4767 
LOG=N
R=adamk@chromium.org

Review-Url: https://codereview.chromium.org/1723313002
Cr-Commit-Position: refs/heads/master@{#35914}

[modify] https://crrev.com/efe5b72d021f4b099e445bf1118b71df065d6e8c/src/ast/scopes.h
[modify] https://crrev.com/efe5b72d021f4b099e445bf1118b71df065d6e8c/src/parsing/parser-base.h
[modify] https://crrev.com/efe5b72d021f4b099e445bf1118b71df065d6e8c/src/parsing/parser.cc
[modify] https://crrev.com/efe5b72d021f4b099e445bf1118b71df065d6e8c/src/parsing/preparser.cc
[modify] https://crrev.com/efe5b72d021f4b099e445bf1118b71df065d6e8c/src/parsing/preparser.h
[modify] https://crrev.com/efe5b72d021f4b099e445bf1118b71df065d6e8c/src/parsing/scanner.cc
[modify] https://crrev.com/efe5b72d021f4b099e445bf1118b71df065d6e8c/src/parsing/token.h
[modify] https://crrev.com/efe5b72d021f4b099e445bf1118b71df065d6e8c/test/cctest/test-parsing.cc

Comment 4 by adamk@chromium.org, Apr 29 2016

Status: Fixed (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, May 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/46b932f405836949c19b43670571aeb458ef5a62

commit 46b932f405836949c19b43670571aeb458ef5a62
Author: bjaideep <bjaideep@ca.ibm.com>
Date: Tue May 03 14:24:19 2016

AIX:Proposal to use kSemaphoreAlignmentMask instead kPointerAlignmentMask

native_handle_ on AIX64 is of type int, and therefore fails
on an operation with a pointer type. Use
kSemaphoreAlignmentMask as sizeof(int) on AIX and
sizeof(pointer) otherwise.

R=jochen@chromium.org, mbrandy@us.ibm.com

BUG= v8:4767 
LOG=N

Review-Url: https://codereview.chromium.org/1936003002
Cr-Commit-Position: refs/heads/master@{#35988}

[modify] https://crrev.com/46b932f405836949c19b43670571aeb458ef5a62/src/base/platform/semaphore.cc

Labels: Priority-2

Sign in to add a comment