Chromium Code Reviews| 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 c46f2f42b49b0d96f54c624576d92c45da2c46ba..e8e0497ba1051b052f4a149bf011b1af0098c30d 100644 |
| --- a/lib/compiler/implementation/lib/js_helper.dart |
| +++ b/lib/compiler/implementation/lib/js_helper.dart |
| @@ -178,7 +178,8 @@ shr(var a, var 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); |
| + if (a >= 0) return JS('num', @'# >>> #', a, b); |
| + return JS('num', @'(# >> #) >>> 0', a, b); |
|
ngeoffray
2012/05/22 15:46:31
Please add a comment on what this entails.
floitsch
2012/05/22 21:07:37
Done.
|
| } |
| return UNINTERCEPTED(a >> b); |
| } |