зеркало из https://github.com/mozilla/gecko-dev.git
Backing out fix for bug 543682 because test failed
This commit is contained in:
Коммит
ccaaab8dd7
|
@ -929,7 +929,7 @@ class TypedArrayTemplate
|
||||||
{
|
{
|
||||||
NativeType *dest = static_cast<NativeType*>(data);
|
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);
|
JS_ASSERT(ar->fslots[JSSLOT_ARRAY_LENGTH] == (jsval)len);
|
||||||
|
|
||||||
jsval *src = ar->dslots;
|
jsval *src = ar->dslots;
|
||||||
|
@ -940,12 +940,6 @@ class TypedArrayTemplate
|
||||||
*dest++ = NativeType(JSVAL_TO_INT(v));
|
*dest++ = NativeType(JSVAL_TO_INT(v));
|
||||||
} else if (JSVAL_IS_DOUBLE(v)) {
|
} else if (JSVAL_IS_DOUBLE(v)) {
|
||||||
*dest++ = NativeType(*JSVAL_TO_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 {
|
} else {
|
||||||
jsdouble dval;
|
jsdouble dval;
|
||||||
if (!JS_ValueToNumber(cx, v, &dval))
|
if (!JS_ValueToNumber(cx, v, &dval))
|
||||||
|
@ -965,9 +959,6 @@ class TypedArrayTemplate
|
||||||
*dest++ = NativeType(JSVAL_TO_INT(v));
|
*dest++ = NativeType(JSVAL_TO_INT(v));
|
||||||
} else if (JSVAL_IS_DOUBLE(v)) {
|
} else if (JSVAL_IS_DOUBLE(v)) {
|
||||||
*dest++ = NativeType(*JSVAL_TO_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 {
|
} else {
|
||||||
jsdouble dval;
|
jsdouble dval;
|
||||||
if (!JS_ValueToNumber(cx, v, &dval))
|
if (!JS_ValueToNumber(cx, v, &dval))
|
||||||
|
|
|
@ -194,21 +194,6 @@ function test()
|
||||||
check(function() a[2] == 0);
|
check(function() a[2] == 0);
|
||||||
check(function() a[3] == 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");
|
print ("done");
|
||||||
|
|
||||||
reportCompare(0, TestFailCount, "typed array tests");
|
reportCompare(0, TestFailCount, "typed array tests");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче