Backing out fix for bug 543682 because test failed

This commit is contained in:
Robert O'Callahan 2010-03-04 16:36:31 +13:00
Родитель 7593dadccb 7d350b017b
Коммит ccaaab8dd7
2 изменённых файлов: 1 добавлений и 25 удалений

Просмотреть файл

@ -929,7 +929,7 @@ class TypedArrayTemplate
{
NativeType *dest = static_cast<NativeType*>(data);
if (ar->isDenseArray() && js_DenseArrayCapacity(ar) >= len) {
if (ar->isDenseArray()) {
JS_ASSERT(ar->fslots[JSSLOT_ARRAY_LENGTH] == (jsval)len);
jsval *src = ar->dslots;
@ -940,12 +940,6 @@ class TypedArrayTemplate
*dest++ = NativeType(JSVAL_TO_INT(v));
} else if (JSVAL_IS_DOUBLE(v)) {
*dest++ = NativeType(*JSVAL_TO_DOUBLE(v));
} else if (v == JSVAL_HOLE) {
// Holes convert to 0.
// XXX for floating-point arrays, they should convert to NaN
// Note that the int32() is necessary, because on MSVC int32 is not the
// same as int, and there's no constructor for uint8_clamped(int).
*dest++ = NativeType(int32(0));
} else {
jsdouble dval;
if (!JS_ValueToNumber(cx, v, &dval))
@ -965,9 +959,6 @@ class TypedArrayTemplate
*dest++ = NativeType(JSVAL_TO_INT(v));
} else if (JSVAL_IS_DOUBLE(v)) {
*dest++ = NativeType(*JSVAL_TO_DOUBLE(v));
} else if (v == JSVAL_VOID) {
// See earlier comment about why int32(0) is necessary
*dest++ = NativeType(int32(0));
} else {
jsdouble dval;
if (!JS_ValueToNumber(cx, v, &dval))

Просмотреть файл

@ -194,21 +194,6 @@ function test()
check(function() a[2] == 0);
check(function() a[3] == 0);
// check handling of holes and non-numeric values
var x = Array(3);
x[0] = "hello";
x[1] = { };
a = new Uint8Array(x);
check(function() a[0] == 0);
check(function() a[1] == 0);
check(function() a[2] == 0);
a = new Float32Array(x);
check(function() a[0] == NaN, TODO); // XXX should be NaN, not 0, most likely
check(function() a[1] == NaN);
check(function() a[2] == NaN);
print ("done");
reportCompare(0, TestFailCount, "typed array tests");