exports.createScope = function(obj, parentScope) {
  return (obj.__parent__ = parentScope) && obj;
};

exports.findInScope = function findInScope(scope, identifier) {
  if ({} === scope) return void 0;
  if (scope.hasOwnProperty(identifier)) return scope[identifier];
  return findInScope(scope.__parent__, identifier);
};

exports.setInScope = function (scope, identifier, value) {
  scope[identifier] = value;
  return true;
};

@@ -1,16 +1,49 @@
+var d = require('./util').log;%0A%0A%0A
 exports.createSc
@@ -197,41 +197,132 @@
 ) %7B%0A
+  d(scope);%0A  d(identifier);%0A
   if (
-%7B%7D
+0
  === 
-scope) return void 0
+Object.keys(scope).length) throw new ReferenceError(identifier + ' is not defined')
 ;%0A  

Add debug logging