// 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-syntaxclassFooextendsPromise{};functionf(){returnnewPromise(r=>88).then(x=>88);}lety;y=f();assertFalse(yinstanceofFoo);y=f();assertFalse(yinstanceofFoo);%OptimizeFunctionOnNextCall(f);y=f();assertFalse(yinstanceofFoo);assertTrue(Reflect.defineProperty(Promise,Symbol.species,{value:Foo}));y=f();assertInstanceof(y,Foo);