2017-04-13 08:09:20 +00:00
|
|
|
// Copyright 2017 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
|
|
|
|
|
|
|
|
var sentinelObject = {};
|
|
|
|
var evaluatedArg = false;
|
|
|
|
class C extends Object {
|
|
|
|
constructor() {
|
|
|
|
try {
|
|
|
|
super(evaluatedArg = true);
|
|
|
|
} catch (e) {
|
|
|
|
assertInstanceof(e, TypeError);
|
|
|
|
return sentinelObject;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-17 11:48:08 +00:00
|
|
|
|
|
|
|
%PrepareFunctionForOptimization(C);
|
2017-04-13 08:09:20 +00:00
|
|
|
Object.setPrototypeOf(C, parseInt);
|
|
|
|
assertSame(sentinelObject, new C());
|
|
|
|
assertSame(sentinelObject, new C());
|
|
|
|
%OptimizeFunctionOnNextCall(C)
|
|
|
|
assertSame(sentinelObject, new C());
|
2020-10-29 15:26:02 +00:00
|
|
|
assertTrue(evaluatedArg);
|