@terrazzo/parser 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/logger.js +4 -3
- package/package.json +1 -1
- package/parse/index.js +1 -1
package/logger.js
CHANGED
|
@@ -54,7 +54,9 @@ export default class Logger {
|
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
if (entry.node) {
|
|
57
|
-
|
|
57
|
+
const e = new TokensJSONError(message);
|
|
58
|
+
e.node = entry.node; // set node on instance, but don’t print to console in constructor
|
|
59
|
+
throw e;
|
|
58
60
|
} else {
|
|
59
61
|
throw new Error(message);
|
|
60
62
|
}
|
|
@@ -111,9 +113,8 @@ export class TokensJSONError extends Error {
|
|
|
111
113
|
/** Erring JSON node */
|
|
112
114
|
node;
|
|
113
115
|
|
|
114
|
-
constructor(message
|
|
116
|
+
constructor(message) {
|
|
115
117
|
super(message);
|
|
116
118
|
this.name = 'TokensJSONError';
|
|
117
|
-
this.node = node;
|
|
118
119
|
}
|
|
119
120
|
}
|
package/package.json
CHANGED
package/parse/index.js
CHANGED
|
@@ -311,7 +311,7 @@ export function resolveAlias(alias, { tokens, logger, source, node, scanned = []
|
|
|
311
311
|
if (!isAlias(token.$value)) {
|
|
312
312
|
return id;
|
|
313
313
|
}
|
|
314
|
-
return resolveAlias(
|
|
314
|
+
return resolveAlias(token.$value, { tokens, logger, node, source, scanned: [...scanned, id] });
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
/** Resolve aliases, update values, and mutate `token` to add `aliasOf` / `partialAliasOf` */
|