Fix 'switch' bytecode generation. Remove __strtof. Fix opcodes pretty-printing.

This commit is contained in:
Ilmir Usmanov
2014-10-16 15:33:54 +04:00
parent 8a58e0b9d5
commit 16556eb830
7 changed files with 132 additions and 115 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ c = a * b;
assert(c == 210);
c = a / b;
assert(c == 2.1);
assert(c >= 2.1 - 0.000001 && c <= 2.1 + 0.000001);
c = a % b;
assert(c == 1);
+1 -1
View File
@@ -27,7 +27,7 @@ assert( very_close_to_1_but_greater > 1.0 );
assert( Math.log (very_close_to_1_but_greater) >= 0.0 );
assert( Math.log (very_close_to_1_but_greater) <= 0.000001 );
var very_close_to_1_but_less = 0.9999999;
var very_close_to_1_but_less = 0.999999;
assert( very_close_to_1_but_less < 1.0 );
assert( Math.log (very_close_to_1_but_less) <= 0.0 );
+15
View File
@@ -47,3 +47,18 @@ switch (a) {
case 3:
assert (0);
}
var counter = 0;
switch ("var") {
case "var":
counter++;
case "var1":
counter++;
case "var2":
counter++;
default:
counter++;
}
assert (counter === 4);