v8/test/mjsunit/regress/regress-v8-9534.js
Marja Hölttä 6d5e538d2b [web snapshots] d8 support for the initial version
Bug: v8:11525
Change-Id: I3ef480e34fa005add44c927e82b50ec31581e632
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2759517
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73465}
2021-03-17 11:59:24 +00:00

19 lines
416 B
JavaScript

// Copyright 2019 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 --stack-size=100 --ignore-unhandled-promises
let i = 0;
function f() {
i++;
if (i > 10) {
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f);
}
new Promise(f);
return f.x;
}
f();