Skip to content

Conversation

@henrydf
Copy link
Contributor

@henrydf henrydf commented Jan 18, 2024

sometimes error.messsage is the key point of debug.
for example,
met a stack overflow before any user code has been executed.

@saghul
Copy link
Contributor

saghul commented Jan 18, 2024

Can you show a sample output? I'd imagine the previous dump of the excetion object would dump Error: message.

@henrydf
Copy link
Contributor Author

henrydf commented Jan 19, 2024

without this commit, it will be

[exception]
put_char @ qjs_wasm.js:1592
write @ qjs_wasm.js:1538
write @ qjs_wasm.js:3261
doWritev @ qjs_wasm.js:5074
_fd_write @ qjs_wasm.js:5088
$__stdio_write @ __stdio_write.c:17
$__vfprintf_internal @ vfprintf.c:746
$vfprintf @ vfprintf.c:761
$fprintf @ fprintf.c:10
$js_dump_obj @ quickjs-libc.c:3863
$js_std_dump_error1 @ quickjs-libc.c:3873
$js_std_dump_error @ quickjs-libc.c:3894
$eval_buf @ qjs-shell.c:66
$initQuickJs @ qjs-shell.c:312
$runScript @ qjs-shell.c:360
(anonymous) @ qjs_wasm.js:715
ccall @ qjs_wasm.js:5186
(anonymous) @ build/:12

@henrydf
Copy link
Contributor Author

henrydf commented Jan 19, 2024

otherwise, it will be:

stack overflow
put_char @ qjs_wasm.js:1592
write @ qjs_wasm.js:1538
write @ qjs_wasm.js:3261
doWritev @ qjs_wasm.js:5074
_fd_write @ qjs_wasm.js:5088
$__stdio_write @ __stdio_write.c:17
$__vfprintf_internal @ vfprintf.c:746
$vfprintf @ vfprintf.c:761
$fprintf @ fprintf.c:10
$js_dump_obj @ quickjs-libc.c:3860
$js_std_dump_error1 @ quickjs-libc.c:3877
$js_std_dump_error @ quickjs-libc.c:3894
$eval_buf @ qjs-shell.c:66
$initQuickJs @ qjs-shell.c:312
$runScript @ qjs-shell.c:360
(anonymous) @ qjs_wasm.js:715
ccall @ qjs_wasm.js:5186
(anonymous) @ build/:12

@saghul
Copy link
Contributor

saghul commented Jan 19, 2024

What about a different type of error like a ReferenceError ?

@henrydf
Copy link
Contributor Author

henrydf commented Jan 20, 2024

In my opinion, message of error instance, is usefull for debug.
So printting it into console, that's enough.

@saghul
Copy link
Contributor

saghul commented Jan 20, 2024

That's not what I asked :-) Can you show an output example with a ReferenceError for example?

@henrydf
Copy link
Contributor Author

henrydf commented Jan 26, 2024

work is busy, i am not sure what your exactly asked. any ReferenceError without this commit in QuickJs? or something else...

@saghul
Copy link
Contributor

saghul commented Jan 26, 2024

YEs, an example of a ReferenceError after the change please.

@bnoordhuis
Copy link
Contributor

In #274, @saghul pointed me to this PR. I just merged that one and I'll go ahead and close this one because we now have a more generalized approach. Thanks anyway for the PR!

@bnoordhuis bnoordhuis closed this Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants