Skip to content

web: add runtime checks for input types of >> and >>> operators #45534

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

Closed
sigmundch opened this issue Mar 30, 2021 · 2 comments
Closed

web: add runtime checks for input types of >> and >>> operators #45534

sigmundch opened this issue Mar 30, 2021 · 2 comments
Labels
area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop. P3 A lower priority bug or feature request web-dart2js web-dev-compiler

Comments

@sigmundch
Copy link
Member

Currently >> and >>> do not check that the input is not a double. This check was elided back in the days of Dart-1 and we can now fix it given the stronger typing guarantees we have today.

Dart2js would need to add some specializations to ensure the checks are optimized away when the types are properly provided.

Example test failure in: corelib/unsigned_shift_test/07 (code such as 2.4 as dynamic >>> 1).

/cc @rakudrama @nshahan

@sigmundch sigmundch added web-dart2js P3 A lower priority bug or feature request web-dev-compiler area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop. labels Mar 30, 2021
@nshahan
Copy link
Contributor

nshahan commented Mar 30, 2021

Duplicate of #45438?

@sigmundch
Copy link
Member Author

yes, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web-js Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop. P3 A lower priority bug or feature request web-dart2js web-dev-compiler
Projects
None yet
Development

No branches or pull requests

2 participants