dart2js produces wrong values in case of shift operations on negative numbers #42892
Labels
area-web-js
Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.
closed-as-intended
Closed as the reported issue is expected behavior
P3
A lower priority bug or feature request
web-dart2js
Compile to dart2js the following program
Compiled code looks like
But these values are wrong.
-1 << 10
produces -1024 in both Dart and JavaScript (triedconsole.log(-1 << 10)
in Chrome 84 and got-1024
)In case of rigth shift
-4 >> 1
produces4294967294
ob dart2js and-2
in Dart and JavaScriptThe text was updated successfully, but these errors were encountered: