diff --git a/src/Plugin.js b/src/Plugin.js index 61cb7d81..a49247fa 100644 --- a/src/Plugin.js +++ b/src/Plugin.js @@ -274,7 +274,10 @@ export default class Plugin { NewExpression(path, state) { const { node } = path; - this.buildExpressionHandler(node, ['callee', 'arguments'], path, state); + this.buildExpressionHandler(node, ['callee'], path, state); + + const argumentsProps = node.arguments.map((_, index) => index); + this.buildExpressionHandler(node.arguments, argumentsProps, path, state); } SwitchStatement(path, state) { diff --git a/test/fixtures/as-arguments-identifier/actual.js b/test/fixtures/as-arguments-identifier/actual.js index 65317a5c..6217cf62 100644 --- a/test/fixtures/as-arguments-identifier/actual.js +++ b/test/fixtures/as-arguments-identifier/actual.js @@ -1,2 +1,3 @@ import { Modal } from 'antd'; const _Modal = bind()(Modal); +const _newModal = new AnyClass(Modal); \ No newline at end of file diff --git a/test/fixtures/as-arguments-identifier/expected.js b/test/fixtures/as-arguments-identifier/expected.js index 9b4579e3..8599660a 100644 --- a/test/fixtures/as-arguments-identifier/expected.js +++ b/test/fixtures/as-arguments-identifier/expected.js @@ -4,4 +4,6 @@ var _modal = _interopRequireDefault(require("antd/lib/modal")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _Modal = bind()(_modal.default); \ No newline at end of file +var _Modal = bind()(_modal.default); + +var _newModal = new AnyClass(_modal.default); \ No newline at end of file