Bug 614603 - RegExp.length and Error.length don't have their ES5-specified values. r=jwalden

--HG--
extra : rebase_source : 145c497576426dd89d423d4ed8431789fc490bde
This commit is contained in:
Jan de Mooij 2010-11-24 19:18:59 +01:00
Родитель 28d89e5beb
Коммит 214c814ed3
5 изменённых файлов: 25 добавлений и 8 удалений

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

@ -1036,7 +1036,7 @@ js_InitExceptionClasses(JSContext *cx, JSObject *obj)
JSProtoKey protoKey = GetExceptionProtoKey(i);
jsid id = ATOM_TO_JSID(cx->runtime->atomState.classAtoms[protoKey]);
JSFunction *fun = js_DefineFunction(cx, obj, id, Exception, 3, JSFUN_CONSTRUCTOR);
JSFunction *fun = js_DefineFunction(cx, obj, id, Exception, 1, JSFUN_CONSTRUCTOR);
if (!fun)
return NULL;
roots[2] = OBJECT_TO_JSVAL(FUN_OBJECT(fun));

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

@ -885,7 +885,7 @@ InitRegExpClassCompile(JSContext *cx, JSObject *obj)
JSObject *
js_InitRegExpClass(JSContext *cx, JSObject *obj)
{
JSObject *proto = js_InitClass(cx, obj, NULL, &js_RegExpClass, regexp_construct, 1,
JSObject *proto = js_InitClass(cx, obj, NULL, &js_RegExpClass, regexp_construct, 2,
NULL, regexp_methods, regexp_static_props, NULL);
if (!proto)
return NULL;

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

@ -0,0 +1,21 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/
*/
var BUGNUMBER = 614603;
var summary = "RegExp.length";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
assertEq(RegExp.length, 2);
assertEq(/a/.constructor.length, 2);
if (typeof reportCompare === "function")
reportCompare(true, true);
print("All tests passed!");

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

@ -1,2 +1,3 @@
url-prefix ../../jsreftest.html?test=ecma_5/RegExp/
script 15.10.5-01.js
script 15.10.7.5-01.js

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

@ -58,8 +58,6 @@
* To do this, just change the two LENGTH constants below -
*/
//-----------------------------------------------------------------------------
var LENGTH_RHINO = 1;
var LENGTH_SPIDERMONKEY = 3;
var UBound = 0;
var BUGNUMBER = 123002;
var summary = 'Testing Error.length';
@ -72,10 +70,7 @@ var expect= '';
var expectedvalues = [];
/*
* Are we in Rhino or SpiderMonkey?
*/
var LENGTH_EXPECTED = inRhino()? LENGTH_RHINO : LENGTH_SPIDERMONKEY;
var LENGTH_EXPECTED = 1;
/*
* The various NativeError objects; see ECMA-262 Edition 3, Section 15.11.6