mirror of
https://github.com/nodejs/node.git
synced 2025-05-22 17:53:49 +00:00

PR-URL: https://github.com/nodejs/node/pull/38273 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Mary Marchini <oss@mmarchini.me>
19 lines
416 B
JavaScript
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();
|