зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1142351 - Part 1: Collect telemetry about deprecated flag argument for String.prototype.{search,match,replace}. r=jandem
This commit is contained in:
Родитель
a3687c2105
Коммит
0493238e94
|
@ -547,6 +547,7 @@ struct JSCompartment
|
||||||
DeprecatedLetBlock = 4, // Added in JS 1.7
|
DeprecatedLetBlock = 4, // Added in JS 1.7
|
||||||
DeprecatedLetExpression = 5, // Added in JS 1.7
|
DeprecatedLetExpression = 5, // Added in JS 1.7
|
||||||
DeprecatedNoSuchMethod = 6, // JS 1.7+
|
DeprecatedNoSuchMethod = 6, // JS 1.7+
|
||||||
|
DeprecatedFlagsArgument = 7, // JS 1.3 or older
|
||||||
DeprecatedLanguageExtensionCount
|
DeprecatedLanguageExtensionCount
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2132,6 +2132,11 @@ class MOZ_STACK_CLASS StringRegExpGuard
|
||||||
/* Build RegExp from pattern string. */
|
/* Build RegExp from pattern string. */
|
||||||
RootedString opt(cx);
|
RootedString opt(cx);
|
||||||
if (optarg < args.length()) {
|
if (optarg < args.length()) {
|
||||||
|
if (JSScript *script = cx->currentScript()) {
|
||||||
|
const char *filename = script->filename();
|
||||||
|
cx->compartment()->addTelemetry(filename, JSCompartment::DeprecatedFlagsArgument);
|
||||||
|
}
|
||||||
|
|
||||||
opt = ToString<CanGC>(cx, args[optarg]);
|
opt = ToString<CanGC>(cx, args[optarg]);
|
||||||
if (!opt)
|
if (!opt)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -345,7 +345,7 @@
|
||||||
"expires_in_version": "never",
|
"expires_in_version": "never",
|
||||||
"kind": "enumerated",
|
"kind": "enumerated",
|
||||||
"n_values": 10,
|
"n_values": 10,
|
||||||
"description": "Use of SpiderMonkey's deprecated language extensions in web content: ForEach=0, DestructuringForIn=1, LegacyGenerator=2, ExpressionClosure=3, LetBlock=4, LetExpression=5, NoSuchMethod=6"
|
"description": "Use of SpiderMonkey's deprecated language extensions in web content: ForEach=0, DestructuringForIn=1, LegacyGenerator=2, ExpressionClosure=3, LetBlock=4, LetExpression=5, NoSuchMethod=6, FlagsArgument=7"
|
||||||
},
|
},
|
||||||
"TELEMETRY_PING": {
|
"TELEMETRY_PING": {
|
||||||
"expires_in_version": "default",
|
"expires_in_version": "default",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче