Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(349)

Unified Diff: tracing/tracing/value/value_set.html

Issue 2153673003: Fix ValueSet.addValuesFromDicts (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tracing/tracing/value/value_set_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/value/value_set.html
diff --git a/tracing/tracing/value/value_set.html b/tracing/tracing/value/value_set.html
index fb424846b3c59dd77f9133cb48eaf1a2fff3c68f..4bfe4e61e5bacf8088faa8155ead9999ca2c3132 100644
--- a/tracing/tracing/value/value_set.html
+++ b/tracing/tracing/value/value_set.html
@@ -73,7 +73,7 @@ tr.exportTo('tr.v', function() {
addValuesFromDicts: function(dicts) {
dicts.forEach(function(dict) {
var value = tr.v.Value.fromDict(dict);
- this.addValue(value);
+ this.addValueInternal_(value);
}, this);
// Now resolve the RelatedValueSet references between values.
@@ -120,14 +120,14 @@ tr.exportTo('tr.v', function() {
return this.toArray().filter(v => v.name.indexOf(name) > -1);
},
- addValue: function(v) {
- if (this.values_[v.guid]) {
- var err = new Error('Tried to add same value twice');
- err.name = 'ValueError';
- throw err;
- }
-
+ addValueInternal_: function(v) {
+ if (this.values_[v.guid])
+ throw new Error('Tried to add same value twice');
this.values_[v.guid] = v;
+ },
+
+ addValue: function(v) {
+ this.addValueInternal_(v);
if (v.numeric instanceof tr.v.Numeric) {
ValueSet.computeSummaryValuesForNumericValue(v).forEach(function(s) {
« no previous file with comments | « no previous file | tracing/tracing/value/value_set_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698