diff --git a/js/rhino/src/org/mozilla/javascript/regexp/NativeRegExp.java b/js/rhino/src/org/mozilla/javascript/regexp/NativeRegExp.java index 08480bec42b1..7fc8284bc847 100644 --- a/js/rhino/src/org/mozilla/javascript/regexp/NativeRegExp.java +++ b/js/rhino/src/org/mozilla/javascript/regexp/NativeRegExp.java @@ -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);