-
Notifications
You must be signed in to change notification settings - Fork 212
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
fix(xsnap): format objects nicely in console using SES assert.quote #3856
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
packages/xsnap/lib/console-shim.js
Outdated
print(` ${i}:`, a.toString ? a.toString() : '<no .toString>', typeof a); | ||
}); | ||
} | ||
// eslint-disable-next-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you disabling here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint doesn't know that xsnap has globalThis.print
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no-undef
was not enough somehow.
note the eslint-disable-next-line
was there before this change. twice three times, in fact.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment explaining this, so it won't look so mysterious to the next reader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* global print */
also works, and TSC interprets it as print : any
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
packages/xsnap/lib/console-shim.js
Outdated
print(` ${i}:`, a.toString ? a.toString() : '<no .toString>', typeof a); | ||
}); | ||
} | ||
// eslint-disable-next-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment explaining this, so it won't look so mysterious to the next reader.
5ad8e36
to
1da421f
Compare
Co-authored-by: Mark S. Miller <[email protected]>
1da421f
to
291f914
Compare
291f914
to
bd937b0
Compare
fixes #3844
A couple things are a little awkward but seem cost-effective:
setQuote()
to break the cycle where SES requiresconsole
andconsole
is implemented usingassert.quote
from SES.print()
.