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

toClj throws exception for js object with property "j" having a numeric value #199

Open
noonian opened this issue Mar 15, 2017 · 1 comment

Comments

@noonian
Copy link

noonian commented Mar 15, 2017

This is a funny one.

Using node 7.4.0 and mori 0.3.2:

> var m = require("mori");
undefined
> m.toClj({j: 42});
Error: No protocol method IEmptyableCollection.-empty defined for type object: [object Object]
    at x (/Users/jed/tmp/node_modules/mori/mori.js:17:63)
    at Na (/Users/jed/tmp/node_modules/mori/mori.js:19:96)
    at Oc (/Users/jed/tmp/node_modules/mori/mori.js:59:358)
    at v (/Users/jed/tmp/node_modules/mori/mori.js:385:474)
    at Function.b [as d] (/Users/jed/tmp/node_modules/mori/mori.js:387:109)
    at Function.a [as b] (/Users/jed/tmp/node_modules/mori/mori.js:385:42)
    at Object.b (/Users/jed/tmp/node_modules/mori/mori.js:422:95)
    at Object.c [as toClj] (/Users/jed/tmp/node_modules/mori/mori.js:422:168)
    at repl:1:3
    at realRunInThisContextScript (vm.js:22:35)
> 

Adding other properties does not change the behavior. Changing "j" to anything else seems to avoid the issue.

@noonian noonian changed the title toClj throws exception for js object with property "j" toClj throws exception for js object with property "j" having a numeric value Mar 15, 2017
@noonian
Copy link
Author

noonian commented Mar 15, 2017

It only seems to happen for objects with property "j" having a numeric value like 10 or 10.5.

Object, string, and array values do not trigger the exception.

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