Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Nested arrays in everyone.now cause deadlock #201

Open
kylebalston opened this Issue · 1 comment

2 participants

@kylebalston

It's possible that I'm misunderstanding NowJS, but I get a deadlock if I execute the following code. I reproduced this using version 0.8.1 of NowJS in the helloworld_server example. It works fine if I initialize the two-dimensional array in a normal variable and then assign everyone.now.x to it.

helloworld_server.js:

var everyone = nowjs.initialize(server);
console.log("Starting...");
everyone.now.x = new Array(3);
console.log(".");
everyone.now.x[0] = new Array(3);
console.log(".");
everyone.now.x[1] = new Array(3);
console.log(".");
everyone.now.x[2] = new Array(3);
console.log("Done!");

Output is:

Starting...
.
.

@steveWang

Preliminary debugging seems that setting an object property to an array results in unexpected behavior. Will fix later; I currently have intermittent internet access.

edit: perhaps it's only arrays initialized via the Array constructor. Behavior seems to be especially strange here: none of the properties are enumerable... until we set them manually. Huh.

I'd suggest for the time being just not using the single-integer-argument Array constructor, since that has really weird behavior (esp. in v8).

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.