teropa/build-your-own-angularjs

P197 Broken Lodash code

Closed this issue · 1 comments

Error reported in lines below, looks the cause is that the map function in current lodash removed the third argument (see https://lodash.com/docs#map):

case AST.ArrayExpression:
  var elements = _.map(ast.elements, function(element) {
    return this.recurse(element); //Error happens here
  }, this);
  return '[]';

could change to this common way:

case AST.ArrayExpression:
  var that = this;
  var elements = _.map(ast.elements, function(element) {
    return that.recurse(element); 
  });
  return '[]';

Yes, this is due to LoDash 4 ugprade. Fixing in upcoming release, thanks