Skip to content

Commit 7999517

Browse files
committed
properly delete nested attributes, update doc crawl
1 parent f168ddc commit 7999517

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/plot_api/plot_schema.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ exports.get = function() {
112112
* @param {String} attrName name string
113113
* @param {object[]} attrs all the attributes
114114
* @param {Number} level the recursion level, 0 at the root
115+
* @param {String} fullAttrString full attribute name (ie 'marker.line')
115116
* @param {Number} [specifiedLevel]
116117
* The level in the tree, in order to let the callback function detect descend or backtrack,
117118
* typically unsupplied (implied 0), just used by the self-recursive call.
@@ -466,9 +467,9 @@ function getTraceAttributes(type) {
466467

467468
// prune global-level trace attributes that are already defined in a trace
468469
exports.crawl(copyModuleAttributes, function(attr, attrName, attrs, level, fullAttrString) {
469-
delete copyBaseAttributes[fullAttrString];
470+
Lib.nestedProperty(copyBaseAttributes, fullAttrString).set(undefined);
470471
// Prune undefined attributes
471-
if(attr === undefined) delete copyModuleAttributes[fullAttrString];
472+
if(attr === undefined) Lib.nestedProperty(copyModuleAttributes, fullAttrString).set(undefined);
472473
});
473474

474475
// base attributes (same for all trace types)

0 commit comments

Comments
 (0)