Fixed regression that causes all avm2 tests to fail in the js shell

Introduced by #882. Sorry.