Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Idents logging support

  • Loading branch information...
commit 5e992f45efdcfe597e7cf4c8bb1e55d7c43fdeaa 1 parent b956a26
@tonistiigi authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/visitor/evaluator.js
View
12 lib/visitor/evaluator.js
@@ -381,7 +381,14 @@ Evaluator.prototype.visitCall = function(call){
if (_info && call.filename === this.filename) {
_info.emit('call', call.lineno - 1 || 0, call.name, fn.filename, fn.lineno);
}
+ // Mark arguments so they won't be logged.
+ args.nodes.forEach(function(n) {
+ n._inCall = true;
+ })
ret = this.invokeFunction(fn, args);
+ args.nodes.forEach(function(n) {
+ n._inCall = null;
+ })
}
// restore kwargs
@@ -409,6 +416,11 @@ Evaluator.prototype.visitIdent = function(ident){
// Lookup
} else if (ident.val.isNull) {
var val = this.lookup(ident.name);
+ if(val) {
+ if (this.options._info && ident.filename == this.options.filename && !val._inCall) {
+ this.options._info.emit('ident', ident.lineno, ident.name, val.filename, val.lineno);
+ }
+ }
return val ? this.visit(val) : ident;
// Assign
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.