mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1054630 - Part 5b: Collect telemetry on usage of SpiderMonkey's deprecated expression closures. r=till
This commit is contained in:
parent
7c3b7c0a5a
commit
4b88986141
@ -433,6 +433,7 @@ Parser<ParseHandler>::Parser(ExclusiveContext *cx, LifoAlloc *alloc,
|
||||
sawDeprecatedForEach(false),
|
||||
sawDeprecatedDestructuringForIn(false),
|
||||
sawDeprecatedLegacyGenerator(false),
|
||||
sawDeprecatedExpressionClosure(false),
|
||||
handler(cx, *alloc, tokenStream, foldConstants, syntaxParser, lazyOuterFunction)
|
||||
{
|
||||
{
|
||||
@ -2273,6 +2274,10 @@ Parser<ParseHandler>::functionArgsAndBodyGeneric(Node pn, HandleFunction fun, Fu
|
||||
report(ParseError, false, null(), JSMSG_CURLY_BEFORE_BODY);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (kind != Arrow)
|
||||
sawDeprecatedExpressionClosure = true;
|
||||
|
||||
tokenStream.ungetToken();
|
||||
bodyType = ExpressionBody;
|
||||
fun->setIsExprClosure();
|
||||
@ -7600,6 +7605,7 @@ Parser<ParseHandler>::accumulateTelemetry()
|
||||
DeprecatedForEach = 0, // JS 1.6+
|
||||
DeprecatedDestructuringForIn = 1, // JS 1.7 only
|
||||
DeprecatedLegacyGenerator = 2, // JS 1.7+
|
||||
DeprecatedExpressionClosure = 3, // Added in JS 1.8, but not version-gated
|
||||
};
|
||||
|
||||
// TODO: Call back into Firefox's Telemetry reporter.
|
||||
@ -7609,6 +7615,8 @@ Parser<ParseHandler>::accumulateTelemetry()
|
||||
(*cb)(JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT, DeprecatedDestructuringForIn);
|
||||
if (sawDeprecatedLegacyGenerator)
|
||||
(*cb)(JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT, DeprecatedLegacyGenerator);
|
||||
if (sawDeprecatedExpressionClosure)
|
||||
(*cb)(JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT, DeprecatedExpressionClosure);
|
||||
}
|
||||
|
||||
template class Parser<FullParseHandler>;
|
||||
|
@ -354,6 +354,7 @@ class Parser : private JS::AutoGCRooter, public StrictModeGetter
|
||||
bool sawDeprecatedForEach:1;
|
||||
bool sawDeprecatedDestructuringForIn:1;
|
||||
bool sawDeprecatedLegacyGenerator:1;
|
||||
bool sawDeprecatedExpressionClosure:1;
|
||||
|
||||
typedef typename ParseHandler::Node Node;
|
||||
typedef typename ParseHandler::DefinitionNode DefinitionNode;
|
||||
|
@ -2930,7 +2930,7 @@ AccumulateTelemetryCallback(int id, uint32_t sample)
|
||||
Telemetry::Accumulate(Telemetry::GC_SCC_SWEEP_MAX_PAUSE_MS, sample);
|
||||
break;
|
||||
case JS_TELEMETRY_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT:
|
||||
MOZ_ASSERT(sample <= 2);
|
||||
MOZ_ASSERT(sample <= 3);
|
||||
Telemetry::Accumulate(Telemetry::JS_DEPRECATED_LANGUAGE_EXTENSIONS_IN_CONTENT, sample);
|
||||
break;
|
||||
default:
|
||||
|
@ -322,7 +322,7 @@
|
||||
"expires_in_version": "never",
|
||||
"kind": "enumerated",
|
||||
"n_values": 10,
|
||||
"description": "Use of SpiderMonkey's deprecated language extensions in web content: ForEach, DestructuringForIn, LegacyGenerator"
|
||||
"description": "Use of SpiderMonkey's deprecated language extensions in web content: ForEach, DestructuringForIn, LegacyGenerator, ExpressionClosure"
|
||||
},
|
||||
"TELEMETRY_PING": {
|
||||
"expires_in_version": "never",
|
||||
|
Loading…
Reference in New Issue
Block a user