Bug 1142351 - Part 1: Collect telemetry about deprecated flag argument for String.prototype.{search,match,replace}. r=jandem

This commit is contained in:
Tooru Fujisawa 2015-03-25 00:36:33 +09:00
Родитель a3687c2105
Коммит 0493238e94
3 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -547,6 +547,7 @@ struct JSCompartment
DeprecatedLetBlock = 4, // Added in JS 1.7
DeprecatedLetExpression = 5, // Added in JS 1.7
DeprecatedNoSuchMethod = 6, // JS 1.7+
DeprecatedFlagsArgument = 7, // JS 1.3 or older
DeprecatedLanguageExtensionCount
};

Просмотреть файл

@ -2132,6 +2132,11 @@ class MOZ_STACK_CLASS StringRegExpGuard
/* Build RegExp from pattern string. */
RootedString opt(cx);
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]);
if (!opt)
return false;

Просмотреть файл

@ -345,7 +345,7 @@
"expires_in_version": "never",
"kind": "enumerated",
"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": {
"expires_in_version": "default",