Sami Vaarala
Sami Vaarala
Any idea why the built-in print() would SIGABRT?
@shdon Could you check if https://github.com/svaarala/duktape/pull/2473 works for you, and what `Duktape.env` you get with it?
:+1: So looks good in this pull now?
Re: SIGABRT, it's best practice for the first call into Duktape to be a protected one (e.g. duk_safe_call()) so that you should not easily be able to invoke an abort.
Ok, merging -- thanks for the testing effort!
Can you provide an example URI so I can build a testcase? The emoji character is likely non-BMP and ECMAScript sees it as two codepoints (surrogate pair). It would match...
Also worth noting that in Duktape 2.x when you push a string it is accepted "as is". In particular this means: - If the input UTF-8 contains non-BMP UTF-8 codepoints...
They'd actually be a bit tricky to implement because current compiler has no intermediate representation. What that means concretely is that when it encounters terms, it will need to know...
I don't think that approach works with the current expression parser: it emits code as it goes along, and there's no "stack" or anything like that for operators. That stack...
The compiler document explains the approach at a high level (it's not a very clean document and a bit out-of-date though). Here's the bit on expression parsing: https://github.com/svaarala/duktape/blob/master/doc/compiler.rst#expression-parsing-algorithm