Project: v8 Issues People Development process History Sign in
New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 48 users
Status: Fixed
Owner:
Closed: Feb 2016
Cc:
HW: ----
OS: ----
Priority: 2
Type: FeatureRequest

Blocked on:
issue 3739



Sign in to add a comment
Make ES6 constructs available in sloppy mode
Reported by m.go...@gmail.com, May 2 2014 Back to list
ECMAScript 6 draft defines let/const to be available outside of strict mode as well. V8 currently doesn't respect that.
 
Comment 1 by arv@chromium.org, May 29 2014
Labels: Harmony
Owner: rossberg@chromium.org
Status: Assigned
Comment 2 by arv@chromium.org, May 29 2014
Cc: u...@chromium.org
Labels: Type-FeatureRequest Priority-Low
Summary: Make ES6 constructs available in sloppy mode (was: Make let/const available in "sloppy mode")
Renamed to reflect the broader issue.
Cc: arv@chromium.org
 Issue 3594  has been merged into this issue.
Cc: rossberg@chromium.org dslomov@chromium.org
 Issue 327  has been merged into this issue.
Blockedon: v8:3739
Labels: -Priority-Low Priority-Medium
Owner: littledan@chromium.org
We decided that this would be on my OKRs for Q3.
Project Member Comment 8 by bugdroid1@chromium.org, Jul 7 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/3973642c98501b3fc5a38c7cde6a908c15222edc

commit 3973642c98501b3fc5a38c7cde6a908c15222edc
Author: arv <arv@chromium.org>
Date: Tue Jul 07 21:57:09 2015

Add a flag for legacy const semantics

This flag is on by default but it will allow us to turn that off in
favor of harmony-sloppy in the future.

BUG= v8:3305 ,  v8:2198 
LOG=N
R=littledan@chromium.org, rossberg@chromium.org

Review URL: https://codereview.chromium.org/1218803006

Cr-Commit-Position: refs/heads/master@{#29526}

[modify] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/src/flag-definitions.h
[modify] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/src/parser.cc
[modify] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/src/preparser.cc
[modify] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/src/preparser.h
[modify] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/test/cctest/test-parsing.cc
[add] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/test/message/no-legacy-const-2.js
[add] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/test/message/no-legacy-const-2.out
[add] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/test/message/no-legacy-const-3.js
[add] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/test/message/no-legacy-const-3.out
[add] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/test/message/no-legacy-const.js
[add] http://crrev.com/3973642c98501b3fc5a38c7cde6a908c15222edc/test/message/no-legacy-const.out

Project Member Comment 9 by bugdroid1@chromium.org, Jul 8 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610

commit 3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610
Author: arv <arv@chromium.org>
Date: Wed Jul 08 15:04:04 2015

[es6] Initial support for let/const bindings in sloppy mode

Allow let in sloppy mode with --harmony-sloppy

Allow ES'15 const in sloppy mode with --harmony-sloppy --no-legacy-const

Functions in block are not done yet. They are only let bound in the block
at this point.

BUG= v8:3305 ,  v8:2198 
LOG=N
R=littledan@chromium.org, rossberg@chromium.org, adamk@chromium.org

Review URL: https://codereview.chromium.org/1219853004

Cr-Commit-Position: refs/heads/master@{#29536}

[modify] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/src/parser.cc
[modify] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/src/preparser.cc
[modify] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/src/preparser.h
[modify] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/test/cctest/test-parsing.cc
[modify] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/test/mjsunit/es6/block-leave.js
[add] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/test/mjsunit/harmony/block-const-assign-sloppy.js
[add] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/test/mjsunit/harmony/block-for-sloppy.js
[add] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/test/mjsunit/harmony/block-leave-sloppy.js
[add] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/test/mjsunit/harmony/block-let-crankshaft-sloppy.js
[add] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/test/mjsunit/harmony/block-let-declaration-sloppy.js
[add] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/test/mjsunit/harmony/block-let-semantics-sloppy.js
[add] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/test/mjsunit/harmony/block-scoping-sloppy.js
[add] http://crrev.com/3b1aabc960ea7a1107c8b6ebb8f2b4ce48e9b610/test/mjsunit/harmony/block-scoping-top-level-sloppy.js

Project Member Comment 10 by bugdroid1@chromium.org, Jul 25 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/2d2b72f6382df11056fb9c39da0581be85510459

commit 2d2b72f6382df11056fb9c39da0581be85510459
Author: littledan <littledan@chromium.org>
Date: Sat Jul 25 00:05:08 2015

Split off a separate --harmony_sloppy_let flag

--harmony_sloppy includes behavior to turn on sloppy mode lexical
bindings. Before this patch, it also included a way to parse let
which is likely web-incompatible (let is disallowed as an
identifier). This patch splits off the let parsing from the more
general block scoping code, so that block scoping can be developed
independently.

R=adamk
LOG=N
BUG= v8:3305 

Review URL: https://codereview.chromium.org/1255013002

Cr-Commit-Position: refs/heads/master@{#29855}

[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/src/bootstrapper.cc
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/src/flag-definitions.h
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/src/parser.cc
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/src/preparser.h
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/test/cctest/test-parsing.cc
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/test/mjsunit/harmony/block-conflicts-sloppy.js
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/test/mjsunit/harmony/block-const-assign-sloppy.js
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/test/mjsunit/harmony/block-for-sloppy.js
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/test/mjsunit/harmony/block-leave-sloppy.js
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/test/mjsunit/harmony/block-let-crankshaft-sloppy.js
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/test/mjsunit/harmony/block-let-declaration-sloppy.js
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/test/mjsunit/harmony/block-let-semantics-sloppy.js
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/test/mjsunit/harmony/block-scoping-sloppy.js
[modify] http://crrev.com/2d2b72f6382df11056fb9c39da0581be85510459/test/mjsunit/harmony/block-scoping-top-level-sloppy.js

Project Member Comment 11 by bugdroid1@chromium.org, Jul 25 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/024e39613a84c3c48796cc52cf52b4e85b2e337a

commit 024e39613a84c3c48796cc52cf52b4e85b2e337a
Author: littledan <littledan@chromium.org>
Date: Sat Jul 25 01:59:16 2015

Class block scoping tests

Class bindings are mutable and lexically scoped, with TDZ semantics.
They may not overlap with var bindings in the same scope. This patch
adds tests for those properties.

R=adamk
BUG= v8:3305 
LOG=N

Review URL: https://codereview.chromium.org/1254003004

Cr-Commit-Position: refs/heads/master@{#29856}

[add] http://crrev.com/024e39613a84c3c48796cc52cf52b4e85b2e337a/test/mjsunit/harmony/block-scope-class.js

Project Member Comment 12 by bugdroid1@chromium.org, Aug 12 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/e261540b9ee3182451faac7fcaba280b987cef10

commit e261540b9ee3182451faac7fcaba280b987cef10
Author: littledan <littledan@chromium.org>
Date: Wed Aug 12 18:42:48 2015

Add class to existing lexical scoping tests

This patch strengthens testing of classes by verifying that the binding
that they export externally follows block scoping, as opposed to var-style
scoping. The tests are based on existing tests for let and const.

R=adamk
LOG=N
BUG= v8:3305 

Review URL: https://codereview.chromium.org/1286923002

Cr-Commit-Position: refs/heads/master@{#30140}

[modify] http://crrev.com/e261540b9ee3182451faac7fcaba280b987cef10/test/mjsunit/es6/block-conflicts.js
[modify] http://crrev.com/e261540b9ee3182451faac7fcaba280b987cef10/test/mjsunit/es6/block-let-declaration.js
[modify] http://crrev.com/e261540b9ee3182451faac7fcaba280b987cef10/test/mjsunit/es6/block-let-semantics.js
[modify] http://crrev.com/e261540b9ee3182451faac7fcaba280b987cef10/test/mjsunit/es6/block-scoping.js
[modify] http://crrev.com/e261540b9ee3182451faac7fcaba280b987cef10/test/mjsunit/harmony/block-conflicts-sloppy.js
[modify] http://crrev.com/e261540b9ee3182451faac7fcaba280b987cef10/test/mjsunit/harmony/block-let-declaration-sloppy.js
[modify] http://crrev.com/e261540b9ee3182451faac7fcaba280b987cef10/test/mjsunit/harmony/block-let-semantics-sloppy.js
[modify] http://crrev.com/e261540b9ee3182451faac7fcaba280b987cef10/test/mjsunit/harmony/block-scoping-sloppy.js

Project Member Comment 13 by bugdroid1@chromium.org, Aug 12 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/9f9cb990a5ccd1514dd684293bbcb98e52031006

commit 9f9cb990a5ccd1514dd684293bbcb98e52031006
Author: littledan <littledan@chromium.org>
Date: Wed Aug 12 23:42:07 2015

Stage sloppy classes

This patch puts --harmony-sloppy into staging. Now that let, lexically-scoped
functions and ES2015 sloppy mode const semantics have been split off into
separate flags, the change only enables classes in sloppy mode.

BUG= v8:3305 
R=adamk
LOG=Y

Review URL: https://codereview.chromium.org/1288153003

Cr-Commit-Position: refs/heads/master@{#30141}

[modify] http://crrev.com/9f9cb990a5ccd1514dd684293bbcb98e52031006/src/flag-definitions.h
[modify] http://crrev.com/9f9cb990a5ccd1514dd684293bbcb98e52031006/test/test262-es6/test262-es6.status

Project Member Comment 14 by bugdroid1@chromium.org, Aug 28 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/decc7b092ae90a378423df760690d58585e9ac71

commit decc7b092ae90a378423df760690d58585e9ac71
Author: littledan <littledan@chromium.org>
Date: Fri Aug 28 18:47:30 2015

Sloppy-mode let parsing

This patch makes 'let' a contextual keyword in both strict and sloppy mode.
It behaves as a keyword when used at the beginning of a StatementListItem
or lexical declaration at the beginning of a for statement, if it is followed
by an identifier, [ or {. Implementing this change requires an extra token
look-ahead by the parser which is only invoked in certain cases (so as to
avoid parsing RegExps as ECMAScript tokens). This might result in a slowdown
of the scanner, but performance testing of this patch hasn't yet found much
of a regression.

BUG= v8:3305 
LOG=Y
R=adamk,vogelheim

Review URL: https://codereview.chromium.org/1315673009

Cr-Commit-Position: refs/heads/master@{#30451}

[modify] http://crrev.com/decc7b092ae90a378423df760690d58585e9ac71/src/parser.cc
[modify] http://crrev.com/decc7b092ae90a378423df760690d58585e9ac71/src/preparser.cc
[modify] http://crrev.com/decc7b092ae90a378423df760690d58585e9ac71/src/preparser.h
[modify] http://crrev.com/decc7b092ae90a378423df760690d58585e9ac71/src/scanner.cc
[modify] http://crrev.com/decc7b092ae90a378423df760690d58585e9ac71/src/scanner.h
[modify] http://crrev.com/decc7b092ae90a378423df760690d58585e9ac71/src/token.h
[modify] http://crrev.com/decc7b092ae90a378423df760690d58585e9ac71/test/cctest/test-parsing.cc
[add] http://crrev.com/decc7b092ae90a378423df760690d58585e9ac71/test/mjsunit/harmony/block-let-contextual-sloppy.js

Status: Fixed
Status: Started
Project Member Comment 17 by bugdroid1@chromium.org, Sep 1 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/07bc0117be8dc9e63ec14d5f9645c483d60a1bec

commit 07bc0117be8dc9e63ec14d5f9645c483d60a1bec
Author: littledan <littledan@chromium.org>
Date: Tue Sep 01 15:57:33 2015

Stage sloppy let

Move the --harmony-sloppy-let flag to staging for further testing, and
update test262 for the new passing tests. Also increase the strictness
of the parser, even in sloppy mode, to disallow "new legacy compat" for

  for (let x = 5 in {}) {}

which is now a SyntaxError.

BUG= v8:3305 
LOG=Y
R=adamk

Review URL: https://codereview.chromium.org/1327483002

Cr-Commit-Position: refs/heads/master@{#30515}

[modify] http://crrev.com/07bc0117be8dc9e63ec14d5f9645c483d60a1bec/src/flag-definitions.h
[modify] http://crrev.com/07bc0117be8dc9e63ec14d5f9645c483d60a1bec/src/parser.cc
[modify] http://crrev.com/07bc0117be8dc9e63ec14d5f9645c483d60a1bec/test/test262-es6/test262-es6.status

Project Member Comment 18 by bugdroid1@chromium.org, Sep 1 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/d1fa7bccc80ce67ab52cbbd3daadeeab47a365c9

commit d1fa7bccc80ce67ab52cbbd3daadeeab47a365c9
Author: littledan <littledan@chromium.org>
Date: Tue Sep 01 17:36:49 2015

Revert of Stage sloppy let (patchset #7 id:120001 of https://codereview.chromium.org/1327483002/ )

Reason for revert:
Fails a test262 test with --always-opt.

Original issue's description:
> Stage sloppy let
>
> Move the --harmony-sloppy-let flag to staging for further testing, and
> update test262 for the new passing tests. Also increase the strictness
> of the parser, even in sloppy mode, to disallow "new legacy compat" for
>
>   for (let x = 5 in {}) {}
>
> which is now a SyntaxError.
>
> BUG= v8:3305 
> LOG=Y
> R=adamk
>
> Committed: https://crrev.com/07bc0117be8dc9e63ec14d5f9645c483d60a1bec
> Cr-Commit-Position: refs/heads/master@{#30515}

TBR=adamk@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= v8:3305 

Review URL: https://codereview.chromium.org/1324033002

Cr-Commit-Position: refs/heads/master@{#30518}

[modify] http://crrev.com/d1fa7bccc80ce67ab52cbbd3daadeeab47a365c9/src/flag-definitions.h
[modify] http://crrev.com/d1fa7bccc80ce67ab52cbbd3daadeeab47a365c9/src/parser.cc
[modify] http://crrev.com/d1fa7bccc80ce67ab52cbbd3daadeeab47a365c9/test/test262-es6/test262-es6.status

Project Member Comment 19 by bugdroid1@chromium.org, Sep 1 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/a2841eb0dc1f9823faac46320ecae60aa5be0fe0

commit a2841eb0dc1f9823faac46320ecae60aa5be0fe0
Author: littledan <littledan@chromium.org>
Date: Tue Sep 01 20:03:14 2015

Stage sloppy let

Move the --harmony-sloppy-let flag to staging for further testing, and
update test262 for the new passing tests. Also increase the strictness
of the parser, even in sloppy mode, to disallow "new legacy compat" for

  for (let x = 5 in {}) {}

which is now a SyntaxError.

BUG= v8:3305 
LOG=Y
R=adamk

Review URL: https://codereview.chromium.org/1321013005

Cr-Commit-Position: refs/heads/master@{#30525}

[modify] http://crrev.com/a2841eb0dc1f9823faac46320ecae60aa5be0fe0/src/flag-definitions.h
[modify] http://crrev.com/a2841eb0dc1f9823faac46320ecae60aa5be0fe0/src/parser.cc
[modify] http://crrev.com/a2841eb0dc1f9823faac46320ecae60aa5be0fe0/test/test262-es6/test262-es6.status

 Issue 3847  has been merged into this issue.
Project Member Comment 21 by 76821325...@developer.gserviceaccount.com, Dec 21 2015
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/4fb5a9ff4f76bab831ceff5e41420e3a2fcd68e2

commit 4fb5a9ff4f76bab831ceff5e41420e3a2fcd68e2
Author: hablich <hablich@chromium.org>
Date: Mon Dec 21 23:07:50 2015

[ES6] Stage sloppy function block scoping

The Inbox problem got resolved so staging is ok.

BUG= v8:3305 
LOG=Y
R=adamk@chromium.org, littledan@chromium.org,rossberg@chromium.org

Review URL: https://codereview.chromium.org/1538243002

Cr-Commit-Position: refs/heads/master@{#32992}

[modify] http://crrev.com/4fb5a9ff4f76bab831ceff5e41420e3a2fcd68e2/src/flag-definitions.h
[modify] http://crrev.com/4fb5a9ff4f76bab831ceff5e41420e3a2fcd68e2/test/test262/test262.status

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

commit fcff8588a5a01587643d6c2507c7b882c78a2957
Author: littledan <littledan@chromium.org>
Date: Wed Jan 06 02:02:42 2016

Ship ES2015 sloppy-mode function hoisting, let, class

This patch doesn't ship all features of ES2015 variable/scoping
changes, notably omitting the removal of legacy const. I think
function hoisting, let and class in sloppy mode can stand to
themselves as a package, and the legacy const change is much
riskier and more likely to be reverted, so my intention is to
pursue those as a separate, follow-on patch.

R=adamk@chromium.org
BUG= v8:4285 , v8:3305 
LOG=Y
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1551443002

Cr-Commit-Position: refs/heads/master@{#33133}

[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/src/flag-definitions.h
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/message/no-legacy-const-2.js
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/message/no-legacy-const-2.out
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/message/no-legacy-const-3.js
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/message/no-legacy-const-3.out
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/message/no-legacy-const.js
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/message/no-legacy-const.out
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/es6/block-early-errors.js
[rename] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/es6/block-eval-var-over-legacy-const.js
[rename] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/es6/block-let-contextual-sloppy.js
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/es6/block-non-strict-errors.js
[rename] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/es6/block-scope-class.js
[rename] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/es6/classes-derived-return-type.js
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/harmony/destructuring.js
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/mjsunit.status
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/regress/regress-91120.js
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/regress/regress-crbug-323936.js
[rename] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mjsunit/regress/regress-crbug-451770.js
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/mozilla/mozilla.status
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/webkit/fast/js/kde/func-decl-expected.txt
[modify] http://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957/test/webkit/webkit.status

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

commit adac5956c6216056a211cfaa460a00ac1500d8f8
Author: littledan <littledan@chromium.org>
Date: Thu Jan 07 20:22:18 2016

Revert of Ship ES2015 sloppy-mode function hoisting, let, class (patchset #7 id:120001 of https://codereview.chromium.org/1551443002/ )

Reason for revert:
Causes frequent crashes in Canary: chromium:537816

Original issue's description:
> Ship ES2015 sloppy-mode function hoisting, let, class
>
> This patch doesn't ship all features of ES2015 variable/scoping
> changes, notably omitting the removal of legacy const. I think
> function hoisting, let and class in sloppy mode can stand to
> themselves as a package, and the legacy const change is much
> riskier and more likely to be reverted, so my intention is to
> pursue those as a separate, follow-on patch.
>
> R=adamk@chromium.org
> BUG= v8:4285 , v8:3305 
> LOG=Y
> CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel
>
> Committed: https://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957
> Cr-Commit-Position: refs/heads/master@{#33133}

TBR=adamk@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= v8:4285 , v8:3305 ,chromium:537816
LOG=Y

Review URL: https://codereview.chromium.org/1565263002

Cr-Commit-Position: refs/heads/master@{#33162}

[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/src/flag-definitions.h
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/message/no-legacy-const-2.js
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/message/no-legacy-const-2.out
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/message/no-legacy-const-3.js
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/message/no-legacy-const-3.out
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/message/no-legacy-const.js
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/message/no-legacy-const.out
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/es6/block-early-errors.js
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/es6/block-non-strict-errors.js
[rename] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/harmony/block-eval-var-over-legacy-const.js
[rename] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/harmony/block-let-contextual-sloppy.js
[rename] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/harmony/block-scope-class.js
[rename] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/harmony/classes-derived-return-type.js
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/harmony/destructuring.js
[rename] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/harmony/regress/regress-crbug-451770.js
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/mjsunit.status
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/regress/regress-91120.js
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mjsunit/regress/regress-crbug-323936.js
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/mozilla/mozilla.status
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/webkit/fast/js/kde/func-decl-expected.txt
[modify] http://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8/test/webkit/webkit.status

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

commit 23235b5fdb5412355e826f7fc0c154c409b9be37
Author: littledan <littledan@chromium.org>
Date: Fri Jan 08 17:34:36 2016

Reland of Ship ES2015 sloppy-mode function hoisting, let, class (patchset #1 id:1 of https://codereview.chromium.org/1565263002/ )

Reason for revert:
Crash fixed by https://codereview.chromium.org/1564923007

Original issue's description:
> Revert of Ship ES2015 sloppy-mode function hoisting, let, class (patchset #7 id:120001 of https://codereview.chromium.org/1551443002/ )
>
> Reason for revert:
> Causes frequent crashes in Canary: chromium:537816
>
> Original issue's description:
> > Ship ES2015 sloppy-mode function hoisting, let, class
> >
> > This patch doesn't ship all features of ES2015 variable/scoping
> > changes, notably omitting the removal of legacy const. I think
> > function hoisting, let and class in sloppy mode can stand to
> > themselves as a package, and the legacy const change is much
> > riskier and more likely to be reverted, so my intention is to
> > pursue those as a separate, follow-on patch.
> >
> > R=adamk@chromium.org
> > BUG= v8:4285 , v8:3305 
> > LOG=Y
> > CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel
> >
> > Committed: https://crrev.com/fcff8588a5a01587643d6c2507c7b882c78a2957
> > Cr-Commit-Position: refs/heads/master@{#33133}
>
> TBR=adamk@chromium.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG= v8:4285 , v8:3305 ,chromium:537816
> LOG=Y
>
> Committed: https://crrev.com/adac5956c6216056a211cfaa460a00ac1500d8f8
> Cr-Commit-Position: refs/heads/master@{#33162}

TBR=adamk@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= v8:4285 , v8:3305 ,chromium:537816

Review URL: https://codereview.chromium.org/1571793002

Cr-Commit-Position: refs/heads/master@{#33189}

[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/src/flag-definitions.h
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/message/no-legacy-const-2.js
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/message/no-legacy-const-2.out
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/message/no-legacy-const-3.js
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/message/no-legacy-const-3.out
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/message/no-legacy-const.js
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/message/no-legacy-const.out
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/es6/block-early-errors.js
[rename] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/es6/block-eval-var-over-legacy-const.js
[rename] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/es6/block-let-contextual-sloppy.js
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/es6/block-non-strict-errors.js
[rename] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/es6/block-scope-class.js
[rename] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/es6/classes-derived-return-type.js
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/harmony/destructuring.js
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/mjsunit.status
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/regress/regress-91120.js
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/regress/regress-crbug-323936.js
[rename] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mjsunit/regress/regress-crbug-451770.js
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/mozilla/mozilla.status
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/webkit/fast/js/kde/func-decl-expected.txt
[modify] http://crrev.com/23235b5fdb5412355e826f7fc0c154c409b9be37/test/webkit/webkit.status

Project Member Comment 25 by 76821325...@developer.gserviceaccount.com, Jan 11 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/95145fa82612dda7cee08e2ffee4b4316cb328e1

commit 95145fa82612dda7cee08e2ffee4b4316cb328e1
Author: littledan <littledan@chromium.org>
Date: Mon Jan 11 23:09:27 2016

Ship ES2015 sloppy-mode const semantics

This patch moves the semantics of 'const' in sloppy mode to match those
in strict mode, that is, const makes lexical (let-like) bindings, must
have an initializer, and does not create properties of the global object.

R=adamk
LOG=Y
BUG= v8:3305 
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1571873004

Cr-Commit-Position: refs/heads/master@{#33218}

[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/src/flag-definitions.h
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/cctest/compiler/test-run-jsops.cc
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/cctest/compiler/test-run-variables.cc
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/cctest/interpreter/test-bytecode-generator.cc
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/cctest/test-decls.cc
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/cctest/test-parsing.cc
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/compiler/regress-96989.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/compiler/regress-const.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/const-declaration.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/const-eval-init.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/const-redecl.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/const.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/constant-folding.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/debug-evaluate-const.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/declare-locally.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/es6/block-eval-var-over-legacy-const.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/es6/block-let-contextual-sloppy.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/global-const-var-conflicts.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/parallel-optimize-disabled.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/property-load-across-eval.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-1178598.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-1182832.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-1199637.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-1201933.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-1207276.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-1213575.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-186.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-3138.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-436896.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-641.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-799761.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-88591.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-debugger-redirect.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mjsunit/regress/regress-handle-illegal-redeclaration.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/mozilla/mozilla.status
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/test262/test262.status
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/webkit/const-without-initializer.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/webkit/constant-count.js
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/webkit/fast/js/arguments-expected.txt
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/webkit/fast/js/function-toString-parentheses-expected.txt
[modify] http://crrev.com/95145fa82612dda7cee08e2ffee4b4316cb328e1/test/webkit/fast/js/parser-syntax-check-expected.txt

Project Member Comment 26 by 76821325...@developer.gserviceaccount.com, Jan 14 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/92610888ddf0070fd01fb668df7f7f78c2d8774e

commit 92610888ddf0070fd01fb668df7f7f78c2d8774e
Author: adamk <adamk@chromium.org>
Date: Thu Jan 14 01:03:06 2016

[test262] Remove stale status lines

The bulk of these were marked simply '[PASS]', while one was marked
'[PASS, FAIL]' but seems to always pass.

BUG= v8:3305 ,  v8:4405 
LOG=n

Review URL: https://codereview.chromium.org/1584863003

Cr-Commit-Position: refs/heads/master@{#33277}

[modify] http://crrev.com/92610888ddf0070fd01fb668df7f7f78c2d8774e/test/test262/test262.status

Status: Fixed
Labels: Priority-2
Project Member Comment 29 by bugdroid1@chromium.org, Jun 9
The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/0d704379421a3b0fb4a8e70441b5f8653bb3040c

commit 0d704379421a3b0fb4a8e70441b5f8653bb3040c
Author: Daniel Ehrenberg <littledan@chromium.org>
Date: Fri Jun 09 13:41:28 2017

[parser] Remove an overzealous syntax error check

In some [1] cases where a lexical declaration is not allowed, ASI will
cause a `let` at the end of a line to be interpreted as an
identifier. A recent patch [2] to fix up the error messages from
misplaced `let` usage was a little overzealous in triggering
the error, throwing a SyntaxError in this edge case. This patch
restores the ASI behavior, which is permitted in JSC and
SpiderMonkey as well. Thanks to a test262 test from Andre Bargull
for raising this issue.

[1] https://tc39.github.io/ecma262/#sec-expression-statement
[2] https://codereview.chromium.org/2697193007

Bug:  v8:3305 
Change-Id: I80ae8ad9a8a93389ff1003323f0d3f003e7a8c8e
Reviewed-on: https://chromium-review.googlesource.com/529225
Reviewed-by: Marja Hölttä <marja@chromium.org>
Commit-Queue: Daniel Ehrenberg <littledan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45817}
[modify] https://crrev.com/0d704379421a3b0fb4a8e70441b5f8653bb3040c/src/parsing/parser-base.h
[modify] https://crrev.com/0d704379421a3b0fb4a8e70441b5f8653bb3040c/test/cctest/test-parsing.cc

Sign in to add a comment