Skip to content

Commit

Permalink
Version 4.8.271.18 (cherry-pick)
Browse files Browse the repository at this point in the history
Merged 953bb41

Ensure arrow functions can close over lexically-scoped variables

BUG=chromium:580934, v8:4255
LOG=N
R=rossberg@chromium.org

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

Cr-Commit-Position: refs/branch-heads/4.8@{crosswalk-project#21}
Cr-Branched-From: 10449d4-refs/heads/4.8.271@{#1}
Cr-Branched-From: 2ebd5fc-refs/heads/master@{#31941}
  • Loading branch information
ajklein committed Feb 1, 2016
1 parent fa163e2 commit 97f7d15
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 8
#define V8_BUILD_NUMBER 271
#define V8_PATCH_LEVEL 17
#define V8_PATCH_LEVEL 18

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
2 changes: 1 addition & 1 deletion src/preparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -3926,7 +3926,7 @@ ParserBase<Traits>::ParseArrowFunctionLiteral(
// Multiple statement body
Consume(Token::LBRACE);
bool is_lazily_parsed =
(mode() == PARSE_LAZILY && scope_->AllowsLazyCompilation());
(mode() == PARSE_LAZILY && scope_->AllowsLazyParsing());
if (is_lazily_parsed) {
body = this->NewStatementList(0, zone());
this->SkipLazyFunctionBody(&materialized_literal_count,
Expand Down
18 changes: 18 additions & 0 deletions test/mjsunit/regress/regress-crbug-580934.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --min-preparse-length=0

"use strict";
{
let one = () => {
return "example.com";
};

let two = () => {
return one();
};

assertEquals("example.com", two());
}

0 comments on commit 97f7d15

Please sign in to comment.