6f17f5d1ae
When analyzing functions scopes with the script_scope as parent, don't skip migrating unresolved variables upwards if we could still be inside an arrow head, which means accesses to those variables will be correctly context allocated. Bug: v8:8510, chromium:1000094 Change-Id: I684f2f8bc692de420203990f93e5c943b5b769c9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1789705 Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Dan Elphick <delphick@chromium.org> Cr-Commit-Position: refs/heads/master@{#63635}
16 lines
422 B
JavaScript
16 lines
422 B
JavaScript
// Copyright 2019 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: --enable-lazy-source-positions --stress-lazy-source-positions
|
|
|
|
var f = (( {a: b} = {
|
|
a() {
|
|
return b;
|
|
}
|
|
}) => b)()();
|
|
|
|
// b should get assigned to the inner function a, which then ends up returning
|
|
// itself.
|
|
assertEquals(f, f());
|