Fix QUnit test failure

Pre-ES5, non-objects are not allowed as function context, so they are either
casted to an object (e.g. new String('-1') or new Boolean(true) which are
typeof 'object') or replaced with the global object if no valid object can be
created.

Using a named parameter to refer to the current item in $.each fixes it.

Bug: 50138
Change-Id: Ice481fef297b0fc14a2ebdedcb21b8d4bdf40563
Merge "Fix QUnit test failure"