refactor: debugging usage
This commit is contained in:
parent
3905bd5f09
commit
a7f1372df1
|
@ -1,9 +1,11 @@
|
|||
import D from 'debug';
|
||||
|
||||
import {Globals} from './globals';
|
||||
import {TraversalCompiler} from './traversal-compiler';
|
||||
import {TypeMap} from './types';
|
||||
|
||||
const compiled = new Map();
|
||||
const debug = D('@avocado:behavior:context');
|
||||
|
||||
class Context extends Map {
|
||||
|
||||
|
@ -62,7 +64,8 @@ class Context extends Map {
|
|||
traverseOneStep(steps, node, step) {
|
||||
if ('undefined' === typeof node) {
|
||||
const rendered = this.renderStepsUntilNow(steps, step);
|
||||
throw TypeError(`"${rendered}" is traversed through but undefined`);
|
||||
debug(`"${rendered}" is traversed through but undefined`);
|
||||
return;
|
||||
}
|
||||
switch (step.type) {
|
||||
case 'key':
|
||||
|
@ -86,7 +89,8 @@ class Context extends Map {
|
|||
return node[step.key] = value.get(this);
|
||||
case 'invoke':
|
||||
const rendered = this.renderStepsUntilNow(steps, step);
|
||||
throw new ReferenceError(`invalid assignment to function "${rendered}"`);
|
||||
debug(`invalid assignment to function "${rendered}"`);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import {Synchronized} from '@avocado/state';
|
|||
|
||||
import {hasTrait, lookupTrait} from './trait-registry';
|
||||
|
||||
const debug = D('@avocado/entity:traits');
|
||||
const debug = D('@avocado:entity:traits');
|
||||
|
||||
function copyTraitProperties(from, to, instance) {
|
||||
do {
|
||||
|
|
Loading…
Reference in New Issue
Block a user