Skip to content

Commit f68504b

Browse files
mochaaPsaghul
andcommitted
api-test: use default stack size for overflow test
Co-authored-by: Saúl Ibarra Corretgé <s@saghul.net>
1 parent 5c0daf8 commit f68504b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

api-test.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#define MAX_TIME 10
99

10-
static int timeout_interrupt_handler(JSRuntime *rt, void *opaque)
10+
static int timeout_interrupt_handler(JSRuntime *rt, void *opaque)
1111
{
1212
int *time = (int *)opaque;
1313
if (*time <= MAX_TIME)
@@ -17,7 +17,7 @@ static int timeout_interrupt_handler(JSRuntime *rt, void *opaque)
1717

1818
static void sync_call(void)
1919
{
20-
const char *code =
20+
const char *code =
2121
"(function() { \
2222
try { \
2323
while (true) {} \
@@ -42,7 +42,7 @@ static void sync_call(void)
4242

4343
static void async_call(void)
4444
{
45-
const char *code =
45+
const char *code =
4646
"(async function() { \
4747
const loop = async () => { \
4848
await Promise.resolve(); \
@@ -96,8 +96,6 @@ static void async_call_stack_overflow(void)
9696

9797
JSRuntime *rt = JS_NewRuntime();
9898
JSContext *ctx = JS_NewContext(rt);
99-
JS_SetMaxStackSize(rt, 128 * 1024);
100-
JS_UpdateStackTop(rt);
10199
JSValue value = JS_UNDEFINED;
102100
JS_SetContextOpaque(ctx, &value);
103101
JSValue global = JS_GetGlobalObject(ctx);

0 commit comments

Comments
 (0)