-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
feat(console): reuse deno console's impl #3468
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3468 +/- ##
==========================================
+ Coverage 44.59% 46.14% +1.55%
==========================================
Files 487 487
Lines 50601 50402 -199
==========================================
+ Hits 22563 23257 +694
+ Misses 28038 27145 -893 ☔ View full report in Codecov by Sentry. |
3e28101
to
2d62c17
Compare
The error appears to be an issue with the RegExp, so this PR is ready to merge. |
2d62c17
to
61e4a97
Compare
The issue ridiculousfish/regress#74 was fixed, but no new version has been released. I validated it locally using the latest version. |
61e4a97
to
5ff3d58
Compare
We discussed this in our triage and we think having to load a whole script when loading the console is a little bit funky. Maybe this could benefit from extracting the essentials of the display algorithms and reimplementing them using native Rust code. |
I haven't tested what impact introducing this huge JS file will have on size and performance. I'm also more inclined to rewrite the log function using Rust, but that will be a long-term process and beyond my capabilities. |
For anyone wanting to use deno's console implementation , they can try deno-console. Boa indeed should not introduce such complex logic; it just needs to support atomic types in JavaScript. |
This Pull Request reuses deno's console implementation with the following changes:
The testing use a hacky solution by overriding __boa_print and __boa_no_color to store colorless output into the property __hack_print_output of a global object.
An odd problem occurs when attempting to output an array containing Chinese characters using
console.log(['你', '好'])
. However, the code runs successfully if the join() function is used before the output:console.log(['你', '好'].join())
. I don't know how to fix this...