tessel / t1-runtime

[UNMAINTAINED] Tessel 1 JavaScript runtime.
Other
117 stars 33 forks source link

Assigning object property with bracket syntax fails for some property names #670

Open mykwillis opened 10 years ago

mykwillis commented 10 years ago

I have some code that dynamically creates object properties based on string representations of large integers. It seems the Tessel runtime does not deal with these properly:

var o = {};
var p1 = "12345678912334455533345"
var p2 = "456543533532566432354533564245"

o[p1] = '1';
o[p2] = '2';

console.log(o[p1]); // "2" (!)
console.log(o[p2]); // "2"

If I prepend a letter to the long strings (e.g., "A12345678...."), everything's OK. Similarly, if I use a short string like "12345678", everything also works OK.

I've verified that things work as expected in the Node.js runtime.