2015-12-02 10:39:33 +00:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
// Flags: --allow-natives-syntax
|
|
|
|
|
2019-06-12 14:00:50 +00:00
|
|
|
var x = Object.getOwnPropertyDescriptor({get x() {}}, 'x').get;
|
2015-12-02 10:39:33 +00:00
|
|
|
function f(o, b) {
|
|
|
|
if (b) {
|
|
|
|
return o instanceof x;
|
|
|
|
}
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(f);
|
2015-12-02 10:39:33 +00:00
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
f();
|
|
|
|
|
|
|
|
function g() {
|
|
|
|
return new x();
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(g);
|
2015-12-02 10:39:33 +00:00
|
|
|
%OptimizeFunctionOnNextCall(g);
|
2019-06-12 14:00:50 +00:00
|
|
|
assertThrows(() => g());
|