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

inconsistent export behavior #165

Closed
andrewrk opened this issue Sep 5, 2012 · 1 comment
Closed

inconsistent export behavior #165

andrewrk opened this issue Sep 5, 2012 · 1 comment

Comments

@andrewrk
Copy link

andrewrk commented Sep 5, 2012

http://satyr.github.com/cup/#c:export%20const%20foo1%20=%20-%3E%20%22hi%22%0A%0Aconst%20foo2%20=%20-%3E%20%22hi%22%0Aexport%20foo2

code:

export const foo1 = -> "hi"

const foo2 = -> "hi"
export foo2

expected:

var foo1, foo2, out$ = typeof exports != 'undefined' && exports || this;
foo1 = function(){
  return "hi";
};
out$.foo1 = foo1;
foo2 = function(){
  return "hi";
};
out$.foo2 = foo2;

actual:

var foo1, foo2, out$ = typeof exports != 'undefined' && exports || this;
import$(out$, foo1 = function(){
  return "hi";
});
foo2 = function(){
  return "hi";
};
out$.foo2 = foo2;
function import$(obj, src){
  var own = {}.hasOwnProperty;
  for (var key in src) if (own.call(src, key)) obj[key] = src[key];
  return obj;
}
@satyr
Copy link
Owner

satyr commented Sep 5, 2012

Looks like I forgot to make it unroll sub-blocks and managed to write a wrong test. Fixing.

@satyr satyr closed this as completed in bb5b5a3 Sep 5, 2012
andrewrk added a commit to andrewrk/chem that referenced this issue Sep 7, 2012
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

No branches or pull requests

2 participants