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

SetConstr is not defined when using json #11

Closed
freevryheid opened this issue May 16, 2017 · 2 comments
Closed

SetConstr is not defined when using json #11

freevryheid opened this issue May 16, 2017 · 2 comments

Comments

@freevryheid
Copy link
Contributor

freevryheid commented May 16, 2017

I assume the json mod is nim js friendly.

Reproduce using the following as source after compiling to js in the default html template:

include karaxprelude
import json
var jString = "{}"
var jNode = parseJson(jString)
@bluenote10
Copy link
Contributor

This works for me without problems, the generated js output contains:

function setConstr() {

      var result = {};
      for (var i = 0; i < arguments.length; ++i) {
        var x = arguments[i];
        if (typeof(x) == "object") {
          for (var j = x[0]; j <= x[1]; ++j) {
            result[j] = true;
          }
        } else {
          result[x] = true;
        }
      }
      return result;
    }

Do you really see usage of upper-case SetConstr?

@Araq
Copy link
Collaborator

Araq commented May 16, 2017

This was a regression in devel and has been fixed in devel.

@Araq Araq closed this as completed May 16, 2017
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

3 participants