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

Bugfix allow re-export of existing named members #698

Merged
merged 1 commit into from
Jun 21, 2022

Commits on Jun 3, 2022

  1. Add configurable: true to Object.defineProperty to allow overwriting

    duplicate exports.
    
    Consider the following valid code
    
    ```typescript
    // lib1.ts
    export const a = '1';
    
    // lib2.ts
    export const a = '2'
    
    // index.ts
    export * from 'lib1.ts'
    export * from 'lib2.ts'
    export { a } from 'lib2.ts'
    
    ```
    Currently tsc and babel compile this fine but sucrase fails with
    
    ```
    TypeError: Cannot redefine property: a
            at Function.defineProperty (<anonymous>)
    ```
    cpitt committed Jun 3, 2022
    Configuration menu
    Copy the full SHA
    dc899cf View commit details
    Browse the repository at this point in the history