| Index: lib/compiler/implementation/lib/js_helper.dart
|
| diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart
|
| index d092d3b92747b7b5e2ee73fb1d6bc84ef27a57e6..9995935b32a80b604d564c98671d256450b2a224 100644
|
| --- a/lib/compiler/implementation/lib/js_helper.dart
|
| +++ b/lib/compiler/implementation/lib/js_helper.dart
|
| @@ -163,6 +163,9 @@ shl(var a, var b) {
|
| // TODO(floitsch): inputs must be integers.
|
| if (checkNumbers(a, b)) {
|
| if (b < 0) throw new IllegalArgumentException(b);
|
| + // JavaScript only looks at the last 5 bits of the shift-amount. Shifting
|
| + // by 33 is hence equivalent to a shift by 1.
|
| + if (b > 31) return 0;
|
| return JS('num', @'(# << #) >>> 0', a, b);
|
| }
|
| return UNINTERCEPTED(a << b);
|
| @@ -172,6 +175,9 @@ shr(var a, var b) {
|
| // TODO(floitsch): inputs must be integers.
|
| if (checkNumbers(a, b)) {
|
| if (b < 0) throw new IllegalArgumentException(b);
|
| + // JavaScript only looks at the last 5 bits of the shift-amount. Shifting
|
| + // by 33 is hence equivalent to a shift by 1.
|
| + if (b > 31) return 0;
|
| return JS('num', @'# >>> #', a, b);
|
| }
|
| return UNINTERCEPTED(a >> b);
|
|
|