Bug 987669 - Implement JS::ProtoKeyToId. r=luke

This commit is contained in:
Bobby Holley 2014-07-11 09:09:21 -07:00
parent bc8026fc56
commit e3f1bd9b22
2 changed files with 13 additions and 0 deletions

View File

@ -1350,6 +1350,16 @@ JS_GetClassPrototype(JSContext *cx, JSProtoKey key, MutableHandleObject objp)
return GetBuiltinPrototype(cx, key, objp);
}
namespace JS {
JS_PUBLIC_API(void)
ProtoKeyToId(JSContext *cx, JSProtoKey key, MutableHandleId idp)
{
idp.set(NameToId(ClassName(key, cx)));
}
} /* namespace JS */
JS_PUBLIC_API(JSProtoKey)
JS_IdToProtoKey(JSContext *cx, HandleId id)
{

View File

@ -1783,6 +1783,9 @@ IdentifyStandardInstanceOrPrototype(JSObject *obj);
extern JS_PUBLIC_API(JSProtoKey)
IdentifyStandardConstructor(JSObject *obj);
extern JS_PUBLIC_API(void)
ProtoKeyToId(JSContext *cx, JSProtoKey key, JS::MutableHandleId idp);
} /* namespace JS */
extern JS_PUBLIC_API(JSProtoKey)