Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: newExpression arguments not be traverse issue #597

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

J10240221
Copy link
Contributor

@J10240221 J10240221 commented Oct 31, 2021

修复 newExpression arguments 并没有 被转换的问题

  • bug现状说明:
// 源码
import { Button } from 'antd';
console.log(Button);
new A(Button);

// 转译后的代码
var _button = _interopRequireDefault(require("antd/lib/button"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
console.log(_button.default);
new A(Button); // FIXME: 由于 Button 并不会被处理,导致运行时报错:Uncaught ReferenceError: Button is not defined
  • 解决方案
    • 修正对 newExpression 下的 arguments 的转换

@J10240221
Copy link
Contributor Author

@cncolder 十分抱歉打扰您,请问能review一下吗?

@cncolder
Copy link
Contributor

@cncolder 十分抱歉打扰您,请问能review一下吗?

不好意思我不是作者,没有 approval 权限。

@J10240221
Copy link
Contributor Author

@sorrycc 云谦大大,能否 review 下这个 bug 修复,打扰您了

@sorrycc sorrycc merged commit d21264e into umijs:master Nov 3, 2021
zhanguangao pushed a commit to zhanguangao/babel-plugin-module-federation-import that referenced this pull request Sep 1, 2023
Co-authored-by: 华志林 <linmu.hzl@raycloud.com>
This was referenced Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants