[js] use dynamic $iterator for type parameter classes (closes #2451)
Merge pull request #2452 from nadako/2451_js_typeparam_dynamic_iterator

[js] use dynamic $iterator for type parameter classes (closes #2451)