Bugfix for #324006: According to ECMA-262 15.10.6.1: RegExp.prototype.constructor == RegExp

This commit is contained in:
szegedia%freemail.hu 2006-05-29 10:28:09 +00:00
Родитель 3a0e3e1a34
Коммит 1a1043b609
1 изменённых файлов: 12 добавлений и 1 удалений

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

@ -40,7 +40,15 @@ package org.mozilla.javascript.regexp;
import java.io.Serializable;
import org.mozilla.javascript.*;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.IdFunctionObject;
import org.mozilla.javascript.IdScriptableObject;
import org.mozilla.javascript.Kit;
import org.mozilla.javascript.ScriptRuntime;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
import org.mozilla.javascript.Undefined;
/**
* This class implements the RegExp native object.
@ -141,6 +149,9 @@ public class NativeRegExp extends IdScriptableObject implements Function
proto.setPrototype(getObjectPrototype(scope));
NativeRegExpCtor ctor = new NativeRegExpCtor();
// Bug #324006: ECMA-262 15.10.6.1 says "The initial value of
// RegExp.prototype.constructor is the builtin RegExp constructor."
proto.put("constructor", proto, ctor);
ScriptRuntime.setFunctionProtoAndParent(ctor, scope);