Store a reference to the newly created execution context in an aptly named variable, rename global_this_value to just this_value, and only call set_global_object() in a single place.