You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's bad :(
Do you know if the Safari developers are aware of this issue?
The shifts are one of the most efficient ways to determine that the value is an integer in the positive 32-bit range, so we would like to avoid changing our pattern.
I will leave this bug open and talk to others if they can reproduce, and if there are better solutions.
This issue was originally filed by xavier.ha...@gmail.com
What steps will reproduce the problem?
Run this dummy code on Safari iOS 6 or 7
import 'dart:html';
main() {
List<bool> pattern = [true, false];
int index = 0;
int animate() {
for(int i = 0; i < 1; i++) {
int patternIndex = index.abs();
toggle(pattern[patternIndex]);
}
}
int i = 0;
try {
for(; i < 1000; i++) {
animate();
}
}catch(e) {
window.alert('$e: $i');
}
}
toggle(bool on) { }
What is the expected output? What do you see instead?
It runs fine on all browser except iOS Safari.
It shows an alert with "RangeError: value 0: 384"
The reason is that dart2js generates code like this:
if (patternIndex >>> 0 !== patternIndex || patternIndex >= 2)
return H.ioore(t2, patternIndex);
I had a similar issue previously on iOS when doing a >> 0: after a few hundreds executions, it starts to fail.
It clearly looks like a bug in the javascript engine of Safari, but I think dart2js could do something about it and never emmit '>> 0' code.
What version of the product are you using? On what operating system?
Editor: 1.1.0.dev_05_00 (2013-12-20)
Please provide any additional information below.
The text was updated successfully, but these errors were encountered: