Skip to content

Commit d06f6ec

Browse files
committed
- Correct code comment
1 parent a3a9bc5 commit d06f6ec

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

dist/index-es.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, c
441441

442442
function addRet(elems) {
443443
if (Array.isArray(elems)) {
444+
// This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...elems);`
444445
elems.forEach(function (t) {
445446
ret.push(t);
446447
});
@@ -697,6 +698,7 @@ JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropNa
697698
var tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback);
698699

699700
if (Array.isArray(tmp)) {
701+
// This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...tmp);`
700702
tmp.forEach(function (t) {
701703
ret.push(t);
702704
});

dist/index-es.min.js.map

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

dist/index-umd.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@
447447

448448
function addRet(elems) {
449449
if (Array.isArray(elems)) {
450+
// This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...elems);`
450451
elems.forEach(function (t) {
451452
ret.push(t);
452453
});
@@ -703,6 +704,7 @@
703704
var tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback);
704705

705706
if (Array.isArray(tmp)) {
707+
// This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...tmp);`
706708
tmp.forEach(function (t) {
707709
ret.push(t);
708710
});

dist/index-umd.min.js.map

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/jsonpath.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ JSONPath.prototype._trace = function (
262262
const ret = [];
263263
function addRet (elems) {
264264
if (Array.isArray(elems)) {
265-
// This was too slow with Babel against our performance test: ret.push(...elems);
265+
// This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...elems);`
266266
elems.forEach((t) => {
267267
ret.push(t);
268268
});
@@ -441,7 +441,7 @@ JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropNa
441441
for (let i = start; i < end; i += step) {
442442
const tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback);
443443
if (Array.isArray(tmp)) {
444-
// This was too slow with Babel against our performance test: ret.push(...tmp);
444+
// This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...tmp);`
445445
tmp.forEach((t) => {
446446
ret.push(t);
447447
});

0 commit comments

Comments
 (0)