-
Notifications
You must be signed in to change notification settings - Fork 28
#3180. Add more js_interop
tests
#3232
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.
LGTM % some nits!
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// @assertion An opaque reference to a Dart object that can be passed to |
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: Do we need to copy the documentation here and elsewhere? If it ever changes this might become stale.
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 is our usual approach. While the documentation may occasionally become outdated, it can also indicate that the corresponding test needs to be revised. Let's keep it for now.
} | ||
'''); | ||
if (isWasm) { | ||
ExternalDartReference<C> jsC = getCfromJS(); |
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.
You can't really test it because it traps (I think), but worth leaving a comment that if you did toDartObject
, this would error on dart2wasm.
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.
The comment added.
} | ||
|
||
@JS() | ||
external ExternalDartReference<C> getCfromJS(); |
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.
We already have tests for this in the SDK, but you could try ExternalDartReference<C?>
and ExternalDartReference<C>?
variants.
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.
Nullable variants added.
|
||
/// @assertion A JavaScript `BigInt` | ||
/// | ||
/// @description Check that `JSBigInt` can store big integer values (more that |
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: than
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.
Fixed
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! Updated. PTAL.
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// @assertion An opaque reference to a Dart object that can be passed to |
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 is our usual approach. While the documentation may occasionally become outdated, it can also indicate that the corresponding test needs to be revised. Let's keep it for now.
} | ||
'''); | ||
if (isWasm) { | ||
ExternalDartReference<C> jsC = getCfromJS(); |
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.
The comment added.
|
||
/// @assertion A JavaScript `BigInt` | ||
/// | ||
/// @description Check that `JSBigInt` can store big integer values (more that |
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.
Fixed
} | ||
|
||
@JS() | ||
external ExternalDartReference<C> getCfromJS(); |
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.
Nullable variants added.
No description provided.