Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle unprintable objects better in print() #834

Merged
merged 2 commits into from
Jan 18, 2025

Conversation

bnoordhuis
Copy link
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
61 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import a c or js module and print it, show exception in quickjs
2 participants