Commit 5866e31e authored by Oleh Lamzin's avatar Oleh Lamzin Committed by Commit Bot

[Telemetry SWX] Make comment about closure compiler clear

Move a bit down comment about when closure compiler knows that input is
{!Object}.

Change-Id: Ia424d3ecce01e544c44f6e2728dca01e46dcde4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362924
Commit-Queue: Oleh Lamzin <lamzin@google.com>
Reviewed-by: default avatarMahmoud Gawad <mgawad@google.com>
Cr-Commit-Position: refs/heads/master@{#799587}
parent e3d09540
......@@ -313,11 +313,12 @@ class TelemetryProxy {
return null;
}
// After this closure compiler knows that input is {!Object}.
if (typeof input !== 'object') {
return input;
}
// At this point, closure compiler knows that the input is {!Object}.
// 1 rule: convert objects like { value: X } to X, where X is a number.
if (Object.entries(input).length === 1 &&
typeof input['value'] === 'number') {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment