mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1153963 - Add telemetry for regexp.hasOwnProperty("source") and Object.getOwnPropertyDescriptor(regexp, "source") on non-release build. r=till
This commit is contained in:
parent
7aeb354d1d
commit
13fa229bf4
@ -555,6 +555,16 @@ js::obj_hasOwnProperty(JSContext* cx, unsigned argc, Value* vp)
|
||||
jsid id;
|
||||
if (args.thisv().isObject() && ValueToId<NoGC>(cx, idValue, &id)) {
|
||||
JSObject* obj = &args.thisv().toObject();
|
||||
|
||||
#ifndef RELEASE_BUILD
|
||||
if (obj->is<RegExpObject>() && id == NameToId(cx->names().source)) {
|
||||
if (JSScript* script = cx->currentScript()) {
|
||||
const char* filename = script->filename();
|
||||
cx->compartment()->addTelemetry(filename, JSCompartment::RegExpSourceProperty);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Shape* prop;
|
||||
if (obj->isNative() &&
|
||||
NativeLookupOwnProperty<NoGC>(cx, &obj->as<NativeObject>(), id, &prop))
|
||||
|
@ -591,6 +591,7 @@ struct JSCompartment
|
||||
DeprecatedLetExpression = 5, // Added in JS 1.7
|
||||
DeprecatedNoSuchMethod = 6, // JS 1.7+
|
||||
DeprecatedFlagsArgument = 7, // JS 1.3 or older
|
||||
RegExpSourceProperty = 8, // ES5
|
||||
DeprecatedLanguageExtensionCount
|
||||
};
|
||||
|
||||
|
@ -3002,6 +3002,15 @@ js::GetOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
|
||||
return ok;
|
||||
}
|
||||
|
||||
#ifndef RELEASE_BUILD
|
||||
if (obj->is<RegExpObject>() && id == NameToId(cx->names().source)) {
|
||||
if (JSScript* script = cx->currentScript()) {
|
||||
const char* filename = script->filename();
|
||||
cx->compartment()->addTelemetry(filename, JSCompartment::RegExpSourceProperty);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
RootedShape shape(cx);
|
||||
if (!NativeLookupOwnProperty<CanGC>(cx, obj.as<NativeObject>(), id, &shape))
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user