Replace lodash/assign with Object.assign (#5356)

Remove imports to lodash/assign and replace assign with Object.assign.
The lodash/assign is unnecessary for babel 7 as node >4 has the same
functionality built-in with Object.assign as used here.

This resolve the [issue 5353](https://github.com/babel/babel/issues/5353)
This commit is contained in:
Marcelo Dapper
2017-02-22 00:08:20 -03:00
committed by Henry Zhu
parent c1f7d67bae
commit 724c949244
3 changed files with 3 additions and 6 deletions

View File

@@ -2,7 +2,6 @@ import OptionManager from "./file/options/option-manager";
import * as messages from "babel-messages";
import Store from "../store";
import traverse from "babel-traverse";
import assign from "lodash/assign";
import clone from "lodash/clone";
const GLOBAL_VISITOR_PROPS = ["enter", "exit"];
@@ -12,7 +11,7 @@ export default class Plugin extends Store {
super();
this.initialized = false;
this.raw = assign({}, plugin);
this.raw = Object.assign({}, plugin);
this.key = this.take("name") || key;
this.manipulateOptions = this.take("manipulateOptions");

View File

@@ -1,5 +1,4 @@
import cloneDeep from "lodash/cloneDeep";
import assign from "lodash/assign";
import has from "lodash/has";
import traverse from "babel-traverse";
import * as babylon from "babylon";
@@ -23,7 +22,7 @@ export default function (code: string, opts?: Object): Function {
}
}
opts = assign({
opts = Object.assign({
allowReturnOutsideFunction: true,
allowSuperOutsideMethod: true,
preserveComments: false,

View File

@@ -4,7 +4,6 @@ import * as virtualTypes from "./lib/virtual-types";
import buildDebug from "debug";
import invariant from "invariant";
import traverse from "../index";
import assign from "lodash/assign";
import Scope from "../scope";
import * as t from "babel-types";
import { path as pathCache } from "../cache";
@@ -164,7 +163,7 @@ export default class NodePath {
}
}
assign(NodePath.prototype,
Object.assign(NodePath.prototype,
NodePath_ancestry,
NodePath_inference,
NodePath_replacement,