зеркало из https://github.com/mozilla/gecko-dev.git
Bug 822858. r=billm
This commit is contained in:
Родитель
0ce684b6ee
Коммит
17e72bfe5a
|
@ -533,17 +533,6 @@ js_InitRegExpClass(JSContext *cx, HandleObject obj)
|
|||
if (!JS_DefineProperties(cx, ctor, regexp_static_props))
|
||||
return NULL;
|
||||
|
||||
/* Capture normal data properties pregenerated for RegExp objects. */
|
||||
TypeObject *type = proto->getNewType(cx);
|
||||
if (!type)
|
||||
return NULL;
|
||||
AddTypeProperty(cx, type, "source", Type::StringType());
|
||||
AddTypeProperty(cx, type, "global", Type::BooleanType());
|
||||
AddTypeProperty(cx, type, "ignoreCase", Type::BooleanType());
|
||||
AddTypeProperty(cx, type, "multiline", Type::BooleanType());
|
||||
AddTypeProperty(cx, type, "sticky", Type::BooleanType());
|
||||
AddTypeProperty(cx, type, "lastIndex", Type::Int32Type());
|
||||
|
||||
if (!DefineConstructorAndPrototype(cx, global, JSProto_RegExp, ctor, proto))
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -5943,6 +5943,18 @@ JSCompartment::getNewType(JSContext *cx, TaggedProto proto_, JSFunction *fun_, b
|
|||
if (obj->isXML() && !type->unknownProperties())
|
||||
type->flags |= OBJECT_FLAG_UNKNOWN_MASK;
|
||||
#endif
|
||||
|
||||
if (obj->isRegExp()) {
|
||||
AddTypeProperty(cx, type, "source", types::Type::StringType());
|
||||
AddTypeProperty(cx, type, "global", types::Type::BooleanType());
|
||||
AddTypeProperty(cx, type, "ignoreCase", types::Type::BooleanType());
|
||||
AddTypeProperty(cx, type, "multiline", types::Type::BooleanType());
|
||||
AddTypeProperty(cx, type, "sticky", types::Type::BooleanType());
|
||||
AddTypeProperty(cx, type, "lastIndex", types::Type::Int32Type());
|
||||
}
|
||||
|
||||
if (obj->isString())
|
||||
AddTypeProperty(cx, type, "length", Type::Int32Type());
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -3346,12 +3346,6 @@ js_InitStringClass(JSContext *cx, HandleObject obj)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* Capture normal data properties pregenerated for String objects. */
|
||||
TypeObject *type = proto->getNewType(cx);
|
||||
if (!type)
|
||||
return NULL;
|
||||
AddTypeProperty(cx, type, "length", Type::Int32Type());
|
||||
|
||||
if (!DefineConstructorAndPrototype(cx, global, JSProto_String, ctor, proto))
|
||||
return NULL;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче