[quickjs-devel] Re: [PATCH] top-level 'await' (TLA)

  • From: Saúl Ibarra Corretgé <s@xxxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Wed, 25 Jan 2023 20:40:11 +0100

I gave this a quick go in txiki.js but got a core dump:

(gdb) bt
#0  0x0000557311dab0b6 in js_async_function_resume 
(ctx=ctx@entry=0x5573129e8280, s=s@entry=0x557312adb740)
    at /home/saghul/src/txiki.js/deps/quickjs/src/quickjs.c:19252
#1  0x0000557311dac1c2 in js_async_function_call (ctx=0x5573129e8280, 
func_obj=..., this_obj=..., argc=0, argv=<optimized out>, 
    flags=<optimized out>) at 
/home/saghul/src/txiki.js/deps/quickjs/src/quickjs.c:19347
#2  0x0000557311dcee5d in js_evaluate_module (ctx=0x5573129e8280, 
m=0x557312a269a0)
    at /home/saghul/src/txiki.js/deps/quickjs/src/quickjs.c:28400
#3  0x0000557311de5568 in JS_EvalFunctionInternal (sf=0x0, var_refs=0x0, 
this_obj=..., fun_obj=..., ctx=0x5573129e8280, 
    ctx@entry=0x557312a269a0) at 
/home/saghul/src/txiki.js/deps/quickjs/src/quickjs.c:33622
#4  JS_EvalFunction (ctx=ctx@entry=0x5573129e8280, fun_obj=...) at 
/home/saghul/src/txiki.js/deps/quickjs/src/quickjs.c:33637
#5  0x0000557311d23ee3 in tjs__eval_bytecode (ctx=0x5573129e8280, 
buf=<optimized out>, buf_len=<optimized out>)
    at /home/saghul/src/txiki.js/src/eval.c:43
#6  0x0000557311d37907 in TJS_NewRuntimeInternal 
(is_worker=is_worker@entry=false, options=options@entry=0x7fff0cd76400)
    at /home/saghul/src/txiki.js/src/vm.c:225
#7  0x0000557311d37e4a in TJS_NewRuntime () at 
/home/saghul/src/txiki.js/src/vm.c:154
#8  0x0000557311d2039f in main (argc=<optimized out>, argv=<optimized out>) at 
/home/saghul/src/txiki.js/src/cli.c:33

It's mostly a vanilla QuickJS with some extra functions to deal with typed 
arrays, but none of the internals were changed. Any ideas?


Cheers,

-Saúl

On Tue, Jan 24, 2023, at 16:44, Saúl Ibarra Corretgé wrote:

On 19/01/2023 08:13, zamfofex wrote:
Hello, everyone! In November of last year, I decided to spend a few days 
familiarizing myself with QuickJS’s code base, and then adding support for 
top-level ‘await’. I had sent an email then, but I don't think it reached 
the mailing list. (Maybe it’s because I wasn’t subscribed to it then.) It 
passed all of the relevant tests from test262. I will send the patch as an 
attachment. (I’m unsure if this lists allows attachments, so if that fails, 
I’ll send another email sharing the patch some other way.)

This is awesome, thanks a lot for sharing!

I'll certainly apply it and give it a shot in txiki.js :-)


Cheers,

-- 
Saúl

Other related posts: