use of com.github.anba.es6draft.runtime.Realm in project es6draft by anba.
the class ZoneConstructor method CallInZone.
/**
* CallInZone ( zone, callback, thisArg, argumentsList )
*
* @param cx
* the execution context
* @param zone
* the zone object
* @param callback
* the callback function
* @param thisArg
* the function this-value
* @param argumentsList
* the function arguments
* @return the function return value
*/
public static Object CallInZone(ExecutionContext cx, ZoneObject zone, Callable callback, Object thisArg, Object... argumentsList) {
/* step 1 */
Realm zoneRealm = zone.getRealm();
/* step 2 */
ZoneObject beforeZone = zoneRealm.getCurrentZone();
/* steps 3-6 */
try {
/* step 3 */
zoneRealm.setCurrentZone(zone);
/* steps 4, 6 */
return Call(cx, callback, thisArg, argumentsList);
} finally {
/* step 5 */
zoneRealm.setCurrentZone(beforeZone);
}
}
Aggregations