v8/test/mjsunit/es6/regress/regress-4522.js
adamk 4c3c89c1de Properly handle direct evals referencing super in arrow functions
The fix is to broaden the set of cases for when NeedsHomeObject()
returns true. Note that this is broader than it needs to be (since,
e.g., non-arrow function scopes inside a method can't reference
super). But we don't track the types of inner scopes at the moment,
so this is the best we can do.

R=rossberg@chromium.org
BUG=v8:4522
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#31659}
2015-10-29 15:09:51 +00:00

20 lines
337 B
JavaScript

// Copyright 2015 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.
"use strict";
class C {
foo() {
return 42;
}
}
class D extends C {
foo() {
return (() => eval("super.foo()"))();
}
}
assertEquals(42, new D().foo());