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

export named function error #3

Closed
lovetingyuan opened this issue Sep 3, 2018 · 3 comments
Closed

export named function error #3

lovetingyuan opened this issue Sep 3, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@lovetingyuan
Copy link

code:

export function foo(a) {}

transformed

__exports.foo(a) = foo(a); // ? it is wrong obviously, should be __exports.foo = function foo(a) {}
@Rich-Harris Rich-Harris added the bug Something isn't working label Sep 4, 2018
@Rich-Harris
Copy link
Owner

thanks! fixed in 0.0.11

@lovetingyuan
Copy link
Author

lovetingyuan commented Sep 7, 2018

thanks! Btw do you mean to solve the circular dependency problem?

// even.js
import { odd } from './odd.js'
export var counter = 0;
export function even(n) {
  counter++;
  return n == 0 || odd(n - 1);
}

// odd.js
import { even } from './even.js';
export function odd(n) {
  return n != 0 && even(n - 1);
}

the promise returned by __shimport__ will always keep pending status due to the circular dependency.

@Rich-Harris
Copy link
Owner

It's a fair question — I've opened #5 to track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants