add _declarations and _scopeInfo to t.inherits
This commit is contained in:
@@ -27,7 +27,8 @@ exports.ForOfStatement = function (node, parent, scope, file) {
|
||||
|
||||
// push the rest of the original loop body onto our new body
|
||||
block.body = block.body.concat(node.body.body);
|
||||
block._declarations = node.body._declarations;
|
||||
|
||||
t.inherits(loop, node);
|
||||
|
||||
// todo: find out why this is necessary? #538
|
||||
loop._scopeInfo = node._scopeInfo;
|
||||
|
||||
@@ -6,6 +6,7 @@ var isString = require("lodash/lang/isString");
|
||||
var compact = require("lodash/array/compact");
|
||||
var esutils = require("esutils");
|
||||
var object = require("../helpers/object");
|
||||
var merge = require("lodash/object/merge");
|
||||
var Node = require("./node");
|
||||
var each = require("lodash/collection/each");
|
||||
var uniq = require("lodash/array/uniq");
|
||||
@@ -690,10 +691,12 @@ t.inheritsComments = function (child, parent) {
|
||||
*/
|
||||
|
||||
t.inherits = function (child, parent) {
|
||||
child.range = parent.range;
|
||||
child.start = parent.start;
|
||||
child.loc = parent.loc;
|
||||
child.end = parent.end;
|
||||
child._declarations = parent._declarations;
|
||||
child._scopeInfo = parent._scopeInfo;
|
||||
child.range = parent.range;
|
||||
child.start = parent.start;
|
||||
child.loc = parent.loc;
|
||||
child.end = parent.end;
|
||||
t.inheritsComments(child, parent);
|
||||
return child;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user