#1611 fields with name "length" does not work in JS

jessevdam Wed 10 Aug 2011

I have field with the name "length" and it causes problems in at least the chrome browser. When the fan.sys.Type.prototype.$af function try to do

this.m_slots[name] = f;

It says "Uncaught RangeError: Invalid array length".

This caused, because the m_slots is init like

this.m_slots    = [];

which create an array, but we need a hashmap/dictionary so I changed it to

this.m_slots    = {};

Which fixed the problem for my

andy Wed 10 Aug 2011

Good catch, pushed a fix: changeset

Login or Signup to reply.