Skip to content

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

@joshski

Description

@joshski

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions