v8/test/mjsunit/regress/regress-707066.js
Josh Wolfe 1236335551 fix assertion failure with --harmony CreateDynamicFunction() in stack overflow conditions
Bug=chromium:707066
R=littledan@chromium.org, adamk@chromium.org, caitp@igalia.com
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Change-Id: I24ce0a08816940ef4646d0f2de188d4832c823a0
Reviewed-on: https://chromium-review.googlesource.com/474990
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Commit-Queue: Josh Wolfe <jwolfe@igalia.com>
Cr-Commit-Position: refs/heads/master@{#44668}
2017-04-17 20:06:15 +00:00

26 lines
690 B
JavaScript

// Copyright 2017 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: --harmony-function-tostring
// There was a bug in CreateDynamicFunction where a stack overflow
// situation caused an assertion failure.
function test(api) {
function f() {
try {
// induce a stack overflow
f();
} catch(e) {
// this might result in even more stack overflows
api();
}
}
f();
}
test(( function (){}).constructor); // Function
test(( function*(){}).constructor); // GeneratorFunction
test((async function (){}).constructor); // AsyncFunction