Skip to content

Commit e5b2402

Browse files
committed
store debugVersion in object abstraction so don't need to repeatedly retrieve value via container's data attrib
1 parent cd3cc7d commit e5b2402

4 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/js/main.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3309,10 +3309,9 @@
33093309
}
33103310

33113311
Properties.prototype.dump = function (abs) {
3312-
var debugVersion = this.valDumper.getRequestInfo().$container.data('meta').debugVersion;
33133312
var cfg = {
33143313
attributeOutput : abs.cfgFlags & this.valDumper.objectDumper.PROP_ATTRIBUTE_OUTPUT,
3315-
isDynamicSupport : versionCompare(debugVersion, '3.1') >= 0
3314+
isDynamicSupport : versionCompare(abs.debugVersion, '3.1') >= 0
33163315
};
33173316
var label = Object.keys(abs.properties).length
33183317
? 'properties'
@@ -3504,13 +3503,12 @@
35043503
var html = '';
35053504
var strClassname = '';
35063505
var dumpOpts = this.dumper.getDumpOpts();
3507-
var debugVersion;
35083506
try {
3507+
abs.debugVersion = this.dumper.getRequestInfo().$container.data('meta').debugVersion;
35093508
if (typeof abs.sort === 'undefined') {
35103509
abs.sort = 'vis name';
35113510
} else if (abs.sort === 'visibility') {
3512-
debugVersion = this.dumper.getRequestInfo().$container.data('meta').debugVersion;
3513-
if (versionCompare(debugVersion, '3.2') === -1) {
3511+
if (versionCompare(abs.debugVersion, '3.2') === -1) {
35143512
abs.sort = 'vis name';
35153513
}
35163514
}

src/js/main.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js_src/Logger/DumpObject.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,12 @@ DumpObject.prototype.dump = function (abs) {
120120
var self = this
121121
var strClassname = ''
122122
var dumpOpts = this.dumper.getDumpOpts()
123-
var debugVersion
124123
try {
124+
abs.debugVersion = this.dumper.getRequestInfo().$container.data('meta').debugVersion
125125
if (typeof abs.sort === 'undefined') {
126126
abs.sort = 'vis name'
127127
} else if (abs.sort === 'visibility') {
128-
debugVersion = this.dumper.getRequestInfo().$container.data('meta').debugVersion
129-
if (versionCompare(debugVersion, '3.2') === -1) {
128+
if (versionCompare(abs.debugVersion, '3.2') === -1) {
130129
abs.sort = 'vis name'
131130
}
132131
}

src/js_src/Logger/Object/Properties.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ for (name in sectionPrototype) {
1111
}
1212

1313
Properties.prototype.dump = function (abs) {
14-
var debugVersion = this.valDumper.getRequestInfo().$container.data('meta').debugVersion
1514
var cfg = {
1615
attributeOutput : abs.cfgFlags & this.valDumper.objectDumper.PROP_ATTRIBUTE_OUTPUT,
17-
isDynamicSupport : versionCompare(debugVersion, '3.1') >= 0
16+
isDynamicSupport : versionCompare(abs.debugVersion, '3.1') >= 0
1817
}
1918
var label = Object.keys(abs.properties).length
2019
? 'properties'

0 commit comments

Comments
 (0)