c950256013
The constructor and new.target arguments were passed to CallConstruct in the wrong order by BytecodeGraphBuilder, which caused subclassing to be incorrect when optimizing from bytecode. Also clean up some unecessary functions in interpreter.cc found while figuring this out. BUG=chromium:642409 Review-Url: https://codereview.chromium.org/2312103002 Cr-Commit-Position: refs/heads/master@{#39204}
23 lines
431 B
JavaScript
23 lines
431 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: --allow-natives-syntax
|
|
|
|
class SuperClass {
|
|
}
|
|
|
|
class SubClass extends SuperClass {
|
|
constructor() {
|
|
super();
|
|
this.doSomething();
|
|
}
|
|
doSomething() {
|
|
}
|
|
}
|
|
|
|
new SubClass();
|
|
new SubClass();
|
|
%OptimizeFunctionOnNextCall(SubClass);
|
|
new SubClass();
|