Bug 703675: RegExp.prototype should be a regular expression object.

This commit is contained in:
Tor Andersson
2021-03-10 17:26:57 +01:00
parent a34fdf2af8
commit c9d05aabba

View File

@@ -3,6 +3,7 @@
#include "jscompile.h"
#include "jsvalue.h"
#include "jsbuiltin.h"
#include "regexp.h"
static void jsB_globalf(js_State *J, const char *name, js_CFunction cfun, int n)
{
@@ -198,9 +199,12 @@ void jsB_init(js_State *J)
J->Boolean_prototype = jsV_newobject(J, JS_CBOOLEAN, J->Object_prototype);
J->Number_prototype = jsV_newobject(J, JS_CNUMBER, J->Object_prototype);
J->String_prototype = jsV_newobject(J, JS_CSTRING, J->Object_prototype);
J->RegExp_prototype = jsV_newobject(J, JS_COBJECT, J->Object_prototype);
J->Date_prototype = jsV_newobject(J, JS_CDATE, J->Object_prototype);
J->RegExp_prototype = jsV_newobject(J, JS_CREGEXP, J->Object_prototype);
J->RegExp_prototype->u.r.prog = js_regcompx(J->alloc, J->actx, "(?:)", 0, NULL);
J->RegExp_prototype->u.r.source = js_strdup(J, "(?:)");
/* All the native error types */
J->Error_prototype = jsV_newobject(J, JS_CERROR, J->Object_prototype);
J->EvalError_prototype = jsV_newobject(J, JS_CERROR, J->Error_prototype);