You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{myFunction}from"./dep.js"classSomeClass{constructor(properties){this.props=properties;}call(){const{myFunction}=this.propsif(myFunction){myFunction()}else{console.log('DID NOT WORK!')}}}letinstance=newSomeClass({myFunction: ()=>{console.log('CORRECT FUNCTION CALLED')}});instance.call()
If you compile this script with babel everything works as expected.
If you compile and run with SWC - you'll see whatever was in dep.js
It seems like functions that are imported are not properly scoped with functions of the same name that are closer in scope to where they're being called.
To Reproduce
git clone https://github.com/tailwind/swc-issue-578
cd swc-issue-578
npm install
npm run babel # Works as expected
npm run swc # Does not work as expected
The text was updated successfully, but these errors were encountered:
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
The Problem
Say we have a file that looks like this
If you compile this script with babel everything works as expected.
If you compile and run with SWC - you'll see whatever was in
dep.js
It seems like functions that are
import
ed are not properly scoped with functions of the same name that are closer in scope to where they're being called.To Reproduce
The text was updated successfully, but these errors were encountered: