v8/test/mjsunit/regress/regress-crbug-580934.js
adamk 953bb416a3 Ensure arrow functions can close over lexically-scoped variables
ParseArrowFunctionLiteral was erroneously checking AllowsLazyCompilation
rather than AllowsLazyParsing when deciding whether to parse lazily.
This meant that lexically-scoped variables that had no other referents
wouldn't get closed over properly.

BUG=chromium:580934, v8:4255
LOG=y

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

Cr-Commit-Position: refs/heads/master@{#33530}
2016-01-26 23:11:10 +00:00

19 lines
357 B
JavaScript

// 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());
}