Skip to content

Commit 4f8cc53

Browse files
committed
Store the stacklimit before incrementing to get accurate values
1 parent f3ea0d8 commit 4f8cc53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/deref.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,13 @@ module.exports = {
154154
let concreteUtils = components && components.hasOwnProperty('concreteUtils') ?
155155
components.concreteUtils :
156156
DEFAULT_SCHEMA_UTILS;
157-
stack++;
158157

159158
if (analytics.actualStack < stack) {
160159
analytics.actualStack = stack;
161160
}
162161

162+
stack++;
163+
163164
if (stack > stackLimit) {
164165
return { value: ERR_TOO_MANY_LEVELS };
165166
}

0 commit comments

Comments
 (0)