-
Notifications
You must be signed in to change notification settings - Fork 28
#3180. Add more JSAnyOperatorExtension tests #3225
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
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.
This LGTM.
@srujzs, do you have further comments? If you're happy then it would be great if you'd land it (I'm traveling for a few days).
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.
Just a few nits, thanks!
testGreaterThanOrEqualTo(null); | ||
|
||
eval("globalThis.underTest = 0 / 0;"); | ||
testGreaterThanOrEqualTo((0 / 0).jsify()); |
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.
nit: toJS
here and other tests
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.
Updated here and below.
testGreaterThanOrEqualTo((0 / 0).jsify()); | ||
|
||
eval("globalThis.underTest = [0];"); | ||
testGreaterThanOrEqualTo([].jsify()); |
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.
nit: faster to just do <JSAny?>[].toJS
since it's an empty list here and other tests
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.
Thanks! Updated everywhere.
main() { | ||
eval("globalThis.underTest = 42;"); | ||
testOr(42.toJS); | ||
/* |
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.
Are these meant to be commented out?
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.
Thank you for noticing. Rremoved.
); | ||
jsExpectEquals(globalContext["eqTrue"], underTest.strictEquals(true.toJS)); | ||
|
||
if (isJS) { |
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.
I see you've come across our discrepancy on how we have to convert undefined
to Dart null
in dart2wasm :D
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.
Yes :)
|
||
testGreaterThanOrEqualTo(JSAny? underTest) { | ||
eval(r''' | ||
var gtNum = underTest >= 2; |
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.
Sorry, one more comment: prefer globalThis.gtNum
here and everywhere over var gtNum
so we don't have different behavior if we started using strict mode in JS.
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.
Updated everywhere, thanks.
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.
Updated. PTAL.
|
||
testGreaterThanOrEqualTo(JSAny? underTest) { | ||
eval(r''' | ||
var gtNum = underTest >= 2; |
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.
Updated everywhere, thanks.
testGreaterThanOrEqualTo(null); | ||
|
||
eval("globalThis.underTest = 0 / 0;"); | ||
testGreaterThanOrEqualTo((0 / 0).jsify()); |
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.
Updated here and below.
testGreaterThanOrEqualTo((0 / 0).jsify()); | ||
|
||
eval("globalThis.underTest = [0];"); | ||
testGreaterThanOrEqualTo([].jsify()); |
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.
Thanks! Updated everywhere.
main() { | ||
eval("globalThis.underTest = 42;"); | ||
testOr(42.toJS); | ||
/* |
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.
Thank you for noticing. Rremoved.
); | ||
jsExpectEquals(globalContext["eqTrue"], underTest.strictEquals(true.toJS)); | ||
|
||
if (isJS) { |
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.
Yes :)
No description provided.