Skip to content

Erroneous cycle detection #33

Closed
squamos opened this Issue Oct 23, 2012 · 5 comments

2 participants

@squamos
squamos commented Oct 23, 2012

This is not a circular reference, its merely a multiple reference

> var mp = require('msgpack');
undefined
> d = new Date
Tue Oct 23 2012 16:30:04 GMT-0700 (PDT)
> mp.pack({a:d, b:d});
TypeError: Cowardly refusing to pack object with circular reference
    at repl:1:4
    at REPLServer.self.eval (repl.js:111:21)
    at rli.on.e (repl.js:260:20)
    at REPLServer.self.eval (repl.js:118:5)
    at Interface.<anonymous> (repl.js:250:12)
    at Interface.EventEmitter.emit (events.js:88:17)
    at Interface._onLine (readline.js:199:10)
    at Interface._line (readline.js:517:8)
    at Interface._ttyWrite (readline.js:735:14)
    at ReadStream.onkeypress (readline.js:98:10)
@godsflaw
Collaborator

I may have run into something like this when using the module, we should look deeper to see what needs to be fixed. Indeed the code above should not throw an error IMHO.

@squamos
squamos commented Oct 24, 2012

Its a flaw in the cycle checking code. Its simply checking if its seen the object before, regardless of whether that object is parent or not

@squamos
squamos commented Oct 24, 2012

Any chance we can bump the version number and publish to npm?

@godsflaw
Collaborator

tagged an published, let me know if you have problems.

@squamos
squamos commented Oct 24, 2012

Thanks Chris!

@squamos squamos closed this Oct 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.