[js] create proper closure for Array.push (closes #1997)

See #1997
Not sure what are you talking about, but then again, it may be not a good idea to use special case for TLocal at all.