new Array("string") should be ["string"], not silent failure (14545, r=brendan)
git-svn-id: svn://10.0.0.236/trunk@48781 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
4eff9ae16a
commit
4ae847a467
@ -1318,9 +1318,13 @@ Array(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
vector = argv;
|
||||
}
|
||||
else {
|
||||
if (!ValueIsLength(cx, argv[0], &length))
|
||||
return JS_FALSE;
|
||||
vector = NULL;
|
||||
if (!ValueIsLength(cx, argv[0], &length)) {
|
||||
vector = argv;
|
||||
length = 1;
|
||||
} else {
|
||||
vector = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return InitArrayObject(cx, obj, length, vector);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user