Closed Mr0grog closed 2 years ago
Don't merge! Found a bug, adding a test to cover it.
Fixed — I modified all the metrics to include a copy of their tags on the flushed results, so an aggregator or reporter that edits one tag list can’t accidentally change other flushed metrics at the same time.
This is a quick pass at updating some of the syntax to match newer language features I used in recent PRs (#69, #71):
.includes(x)
instead of.indexOf(x) !== -1
.for...of
loops....
) syntax, and using that to modify arrays (where it’s safe!) instead of callingconcat()
, which can be slower and more memory-intense.callbackify
where not necessary.Newer style for functions in object literals:
This does not cover larger syntactical/structural changes, like:
class
syntax.async
/await
keywords.Those are probably better suited to a separate PR, but I can also do them here if we think it makes more sense.