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

compiling with { inScope: false } causes variable redefinition bug #58

Open
joshski opened this issue Dec 18, 2014 · 0 comments
Open

compiling with { inScope: false } causes variable redefinition bug #58

joshski opened this issue Dec 18, 2014 · 0 comments

Comments

@joshski
Copy link
Member

joshski commented Dec 18, 2014

This works

node> require("pogo").compile("x = 0\nfoo\n  x := 1")
'(function() {\n    var self = this;\n    var x;\n    x = 0;\n    foo(function() {\n        return x = 1;\n    });\n}).call(this);'

...but compiling the same code with inScope=false throws an error:

node> require("pogo").compile("x = 0\nfoo\n  x := 1", { inScope: false });
Error: undefined:3
  x := 1
  ^^^^^^
variable x is not defined, use = to define it
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

1 participant