e3d4dd0805
R=bmeurer@chromium.org Change-Id: Idd9c45f733e2e5d518c69a6ead2b56f6433ca30e Reviewed-on: https://chromium-review.googlesource.com/1114598 Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#54020}
30 lines
571 B
JavaScript
30 lines
571 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: --allow-natives-syntax
|
|
|
|
class Foo extends Promise {};
|
|
|
|
function f() {
|
|
return new Promise(r => 88).then(x => 88);
|
|
}
|
|
|
|
let y;
|
|
|
|
y = f();
|
|
assertFalse(y instanceof Foo);
|
|
|
|
y = f();
|
|
assertFalse(y instanceof Foo);
|
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
y = f();
|
|
assertFalse(y instanceof Foo);
|
|
|
|
assertTrue(Reflect.defineProperty(Promise, Symbol.species, {value: Foo}));
|
|
|
|
y = f();
|
|
assertInstanceof(y, Foo);
|