Skip to content

Handle unprintable objects better in print()#834

Merged
bnoordhuis merged 2 commits intoquickjs-ng:masterfrom
bnoordhuis:fix832
Jan 18, 2025
Merged

Handle unprintable objects better in print()#834
bnoordhuis merged 2 commits intoquickjs-ng:masterfrom
bnoordhuis:fix832

Conversation

@bnoordhuis
Copy link
Copy Markdown
Contributor

Before this commit, such objects were printed as <exception> because print() and console.log() had no good way to turn them into strings.

Instead perform the C equivalent of Object.prototype.toString.call(o) and print the result (which can still error but at least we tried.)

Fixes: #832

Before this commit, such objects were printed as `<exception>` because
print() and console.log() had no good way to turn them into strings.

Instead perform the C equivalent of Object.prototype.toString.call(o)
and print the result (which can still error but at least we tried.)

Fixes: quickjs-ng#832
@bnoordhuis bnoordhuis merged commit d07f6b5 into quickjs-ng:master Jan 18, 2025
@bnoordhuis bnoordhuis deleted the fix832 branch January 18, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants