зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset b4268cb7bf48
This commit is contained in:
Родитель
a28d54e951
Коммит
7d350b017b
|
@ -920,7 +920,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;
|
||||
|
@ -931,12 +931,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))
|
||||
|
@ -956,9 +950,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");
|
||||
|
|
Загрузка…
Ссылка в новой задаче