[js] test errors in for loop
[js] test for-in cases where functions/members are accessed (also cases where a global variable is created)
[js] test various 'switch' assertions