Skip to content

Commit

Permalink
fix: debug message
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Sep 6, 2017
1 parent 9006e5b commit b43daf7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/subroutines/readSubroutine.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ import type {
const debug = createDebug('subroutine:read');

const readSubroutine: SubroutineType = (subject, [target, name], {evaluator}) => {
debug('reading property "%s"', name);

if (!evaluator.isElement(subject)) {
throw new SurgeonError('Unexpected value. Value must be an element.');
}

let value;

if (target === 'attribute') {
debug('reading attribute "%s"', name);

value = evaluator.getAttributeValue(subject, name);
} else if (target === 'property') {
debug('reading property "%s"', name);

value = evaluator.getPropertyValue(subject, name);
} else {
throw new SurgeonError('Unexpected read target.');
Expand Down

0 comments on commit b43daf7

Please sign in to comment.