FAIL!
Do we really add an exclamation point out of nowhere?
Created attachment 26920 [details] The patch
Created attachment 26921 [details] Typo fix
Comment on attachment 26921 [details] Typo fix r=me, as long as there is a testcase
Sending JavaScriptCore/ChangeLog Sending JavaScriptCore/interpreter/Interpreter.cpp Sending LayoutTests/ChangeLog Sending LayoutTests/fast/js/resources/switch-behaviour.js Sending LayoutTests/fast/js/switch-behaviour-expected.txt Transmitting file data ..... Committed revision 40111.
Hi, the fix of this bug introduces a new bug. Consider the following code: var a = 5.4 switch(val) { case 1: return 10 case 2: return 11 case 3: return 12 case 5: return 14 case 6: return 15 default: return 100 } The switch selects "case 5", because numberToInt32() converts 5.4 to 5, which is wrong in this case! The right test should be something like this in case of scrutinee is a double value: if ((double)((int)scrutinee) == scrutinee) ... ctiForValue((int)scrutinee)
Could you please file a new bug for this?