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

Nested arrays in everyone.now cause deadlock #201

Open
kylebalston opened this issue May 10, 2012 · 1 comment
Open

Nested arrays in everyone.now cause deadlock #201

kylebalston opened this issue May 10, 2012 · 1 comment

Comments

@kylebalston
Copy link

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
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants