27 Jan 2014, 04:06
Kuma_pancake_pragsmall

Phil Hadviger (1 post)

Hi,

On page 52 and 53 you use Array.prototype.slice.call(null, arguments) in all of the methods.

For me this results in “TypeError: Array.prototype.slice called on null or undefined” no on node.js 0.10.x with or w/o –harmony passed in.

Array.prototype.slice.call(arguments) seems to work for me, but I was curious if I’m misunderstanding something or doing something wrong that is causing me to see this error. I’m still somewhat new to JS, and therefore wanted to confirm.

Outside of this, the book has been amazing so far.

30 Jan 2014, 00:14
Generic-user-small

Steven Harris (4 posts)

I had the same experience? Typo or are we misunderstanding?

17 Mar 2014, 00:47
Generic-user-small

Ivan johns (2 posts)

Try:

router.on('message', function() {
	let frames = Array.apply(null, arguments);
	dealer.send(frames);
});

dealer.on('message', function() {
	let frames = Array.apply(null, arguments);
	router.send(frames);
});
13 Apr 2014, 19:50
Generic-user-small

Christophe Leroy (2 posts)

Got the same problem - but on top of that IPC are not working on Windows 7 for 0MQ. I am using tcp://127.0.0.1:9999 instead of ipc://filer-read.ipc … It was breaking on Array.prototype.slice.call … but it works with Ivan’s suggestion (Array.apply(null, arguments)).

26 May 2014, 11:19
Avatar_pragsmall

Jim R. Wilson (60 posts)

This is a typo and I should fix it. I originally had Array.apply(null, arguments) and meant to change it to Array.prototype.slice.call(arguments).

  You must be logged in to comment