v8/test/mjsunit/regress/regress-crbug-900674.js
Maya Lekova 607033a9e4 [async-hooks] Fix Promise.resolve optimization with async hooks enabled
Promise.resolve shouldn't be optimized when the async hooks are enabled.

Bug: chromium:900674
Change-Id: I225c3d9002f293395993ded37a1d475635467a94
Reviewed-on: https://chromium-review.googlesource.com/c/1335693
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57505}
2018-11-14 15:29:09 +00:00

13 lines
307 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
function foo() {
let val = Promise.resolve().then();
}
foo();
%OptimizeFunctionOnNextCall(foo);
foo();