mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 13:55:43 +00:00
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:
parent
28d89e5beb
commit
214c814ed3
@ -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;
|
||||
|
21
js/src/tests/ecma_5/RegExp/15.10.5-01.js
Normal file
21
js/src/tests/ecma_5/RegExp/15.10.5-01.js
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user