Bug 966957: Concat Float32 too; r=h4writer

This commit is contained in:
Benjamin Bouvier 2014-02-04 15:50:17 +01:00
parent d32c25f85d
commit d58beee5cc
2 changed files with 21 additions and 5 deletions

View File

@ -229,3 +229,22 @@ function testFloorDouble() {
}
test(setupFloor, testFloor);
test(setupFloorDouble, testFloorDouble);
function setupTestToString() {
setupFloor();
setupFloorDouble();
f32[8] = 4 / 3;
f32[9] = 4;
}
function testToString() {
for (var i = 0; i < 10; ++i) {
var f = f32[i];
var str = f + '';
assertFloat32(f, true);
assertEq(str, (f + -0) + '');
if (f !== -0) // -0 + '' === 0
assertEq(parseFloat(str), f);
}
}
test(setupFloorDouble, testToString);

View File

@ -3739,11 +3739,8 @@ IonBuilder::jsop_binary(JSOp op, MDefinition *left, MDefinition *right)
if (op == JSOP_ADD &&
((left->type() == MIRType_String &&
(right->type() == MIRType_String ||
right->type() == MIRType_Int32 ||
right->type() == MIRType_Double)) ||
(left->type() == MIRType_Int32 &&
right->type() == MIRType_String) ||
(left->type() == MIRType_Double &&
IsNumberType(right->type()))) ||
(IsNumberType(left->type()) &&
right->type() == MIRType_String)))
{
MConcat *ins = MConcat::New(alloc(), left, right);