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

Idiomatic JS method names being obfuscated by Closure #169

Open
ds300 opened this issue Jul 21, 2015 · 4 comments
Open

Idiomatic JS method names being obfuscated by Closure #169

ds300 opened this issue Jul 21, 2015 · 4 comments

Comments

@ds300
Copy link

ds300 commented Jul 21, 2015

I've just tried 0.3.2 in io.js

> var m = require('mori')
undefined
> var x = m.hashMap(4, 5)
undefined
> x
{4 5}
> x.get(4)
TypeError: undefined is not a function
    at repl:1:3
    at REPLServer.defaultEval (repl.js:124:27)
    at bound (domain.js:254:14)
    at REPLServer.runBound [as eval] (domain.js:267:12)
    at REPLServer.<anonymous> (repl.js:277:12)
    at emitOne (events.js:77:13)
    at REPLServer.emit (events.js:166:7)
    at REPLServer.Interface._onLine (readline.js:198:10)
    at REPLServer.Interface._line (readline.js:537:8)
    at REPLServer.Interface._ttyWrite (readline.js:814:14)
> x.__proto__
{ toString: [Function],
  t: [Function],
  s: [Function],
  gb: [Function],
  vb: true,
  fb: [Function],
  H: [Function],
  L: [Function],
  B: [Function],
  A: [Function],
  '$a': [Function],
  J: [Function],
  R: [Function],
  O: [Function],
  wb: [Function],
  Ka: [Function],
  rb: [Function],
  D: [Function],
  F: [Function],
  G: [Function],
  call: { [Function] a: [Function], c: [Function] },
  apply: [Function],
  b: [Function],
  a: [Function],
  undefined: [Function],
  I: true,
  v: [Function],
  inspect: [Function] }

I think b or a is get. They both return 5 anyway.

@Frikki
Copy link

Frikki commented Oct 8, 2015

Oct 8, not even a comment!

@ds300
Copy link
Author

ds300 commented Oct 8, 2015

I think the message is pretty clear at this point...

@tgriesser
Copy link
Contributor

The mori API is not a traditional JavaScript chaining syntax, per the docs, the proper way to perform that operation would be:

var m = require('mori')
var x = m.hashMap(4, 5)
m.get(x, 4)

@ds300
Copy link
Author

ds300 commented Oct 8, 2015

@tgriesser See the section of the readme under the heading 'ES6 Map/Set inspired interfaces'.

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