mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-06 01:41:37 +08:00
Bug 703675: RegExp.prototype should be a regular expression object.
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
#include "jscompile.h"
|
#include "jscompile.h"
|
||||||
#include "jsvalue.h"
|
#include "jsvalue.h"
|
||||||
#include "jsbuiltin.h"
|
#include "jsbuiltin.h"
|
||||||
|
#include "regexp.h"
|
||||||
|
|
||||||
static void jsB_globalf(js_State *J, const char *name, js_CFunction cfun, int n)
|
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->Boolean_prototype = jsV_newobject(J, JS_CBOOLEAN, J->Object_prototype);
|
||||||
J->Number_prototype = jsV_newobject(J, JS_CNUMBER, 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->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->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 */
|
/* All the native error types */
|
||||||
J->Error_prototype = jsV_newobject(J, JS_CERROR, J->Object_prototype);
|
J->Error_prototype = jsV_newobject(J, JS_CERROR, J->Object_prototype);
|
||||||
J->EvalError_prototype = jsV_newobject(J, JS_CERROR, J->Error_prototype);
|
J->EvalError_prototype = jsV_newobject(J, JS_CERROR, J->Error_prototype);
|
||||||
|
|||||||
Reference in New Issue
Block a user