umijs / mako

An extremely fast, production-grade web bundler based on Rust.
https://makojs.dev
MIT License
1.83k stars 67 forks source link

bug: Infinity dropped in import specifier #1417

Open stormslowly opened 3 months ago

stormslowly commented 3 months ago
// index.js
import { Infinity } from "./bug1";

Infinity();
// bug1.js
function x() {
  console.log("Inifinity");
}
x.size = [8];

export { x as Infinity };
cargo  mako .  && node dist/index.js
/mako/dead-simple/dist/index.js:10
            Infinity();
            ^

TypeError: Infinity is not a function
stormslowly commented 3 months ago

change index.js like this , everything will be fine

import { Infinity as infi } from "./bug1"; 
infi();
stormslowly commented 3 months ago

will fixed after https://github.com/swc-project/swc/pull/8471 ( swc_core v0.87.22 ), need upgrade swc