summaryrefslogtreecommitdiffstats
path: root/js/src/vm/RegExpObject.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-19 10:42:58 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-19 10:42:58 +0100
commitdf313c5b777daf119385beb8b12c60c33b35a2d0 (patch)
tree774103d300333a82fb02dd3eb928c5583670bcb4 /js/src/vm/RegExpObject.cpp
parentcf70142093eb145b8e349bd7a95e22a55662a6d3 (diff)
downloadUXP-df313c5b777daf119385beb8b12c60c33b35a2d0.tar
UXP-df313c5b777daf119385beb8b12c60c33b35a2d0.tar.gz
UXP-df313c5b777daf119385beb8b12c60c33b35a2d0.tar.lz
UXP-df313c5b777daf119385beb8b12c60c33b35a2d0.tar.xz
UXP-df313c5b777daf119385beb8b12c60c33b35a2d0.zip
Use ordinary object for RegExp prototype
Issue #77
Diffstat (limited to 'js/src/vm/RegExpObject.cpp')
-rw-r--r--js/src/vm/RegExpObject.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
index 97f1163aa..e0b44e1eb 100644
--- a/js/src/vm/RegExpObject.cpp
+++ b/js/src/vm/RegExpObject.cpp
@@ -196,6 +196,12 @@ RegExpObject::trace(JSTracer* trc, JSObject* obj)
}
}
+static JSObject*
+CreateRegExpPrototype(JSContext* cx, JSProtoKey key)
+{
+ return cx->global()->createBlankPrototype(cx, &RegExpObject::protoClass_);
+}
+
static const ClassOps RegExpObjectClassOps = {
nullptr, /* addProperty */
nullptr, /* delProperty */
@@ -229,6 +235,13 @@ const Class RegExpObject::class_ = {
&RegExpObjectClassSpec
};
+const Class RegExpObject::protoClass_ = {
+ js_Object_str,
+ JSCLASS_HAS_CACHED_PROTO(JSProto_RegExp),
+ JS_NULL_CLASS_OPS,
+ &RegExpObjectClassSpec
+};
+
RegExpObject*
RegExpObject::create(ExclusiveContext* cx, const char16_t* chars, size_t length, RegExpFlag flags,
TokenStream* tokenStream, LifoAlloc& alloc)