lib/handlebars/compiler/visitor.js
function(node, name) {
    let value = this.accept(node[name]);
    if (this.mutating) {
      // Hacky sanity check: This may have a few false positives for type for the helper
      // methods but will generally do the right thing without a lot of overhead.
      if (value && !Visitor.prototype[value.type]) {
        throw new Exception('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
      }
      node[name] = value;
    }
  }
function(node, name) {
    let value = this.accept(node[name]);
    if (this.mutating) {
      // Hacky sanity check: This may have a few false positives for type for the helper
      // methods but will generally do the right thing without a lot of overhead.
      if (value && !Visitor.prototype[value.type]) {
        throw new Exception('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
      }
      node[name] = value;
    }
  }
function ( node , name ) { let value = this . accept ( node [ name ] ) ; if ( this . mutating ) { // Hacky sanity check: This may have a few false positives for type for the helper // methods but will generally do the right thing without a lot of overhead. if ( value && ! Visitor . prototype [ value . type ] ) { throw new Exception ( 'Unexpected node type "' + value . type + '" found when accepting ' + name + ' on ' + node . type ) ; } node [ name ] = value ; } }
Visits a given value. If mutating, will replace the value if necessary.
Visits a given value . If mutating will replace the value if necessary .