v8/test/mjsunit/regress/regress-829889.js
Peter Marshall 9160b83211 [runtime] Use the correct generic construct stub based on harmony flags
We hardcoded this accidentally in the original CL for the turbofan case,
instead we need to call JSConstructStubGeneric() which will return the
correct construct stub based on the harmony_restrict_constructor_return
flag.

Bug: chromium:829899
Change-Id: I6776a5daebd57d8881d926ad68595141312a877d
Reviewed-on: https://chromium-review.googlesource.com/1001893
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52470}
2018-04-09 09:29:07 +00:00

18 lines
413 B
JavaScript

// Copyright 2018 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: --harmony-restrict-constructor-return --always-opt
class Base {
constructor(x) {
return x;
}
}
class Derived extends Base {
constructor(use, x) {
super(use, x);
}
}
assertThrows(() => new Derived(true, 5), TypeError);