fn new_global_environment(
    global: Value,
    this_value: Value,
) -> Gc<GcCell<Box<GlobalEnvironmentRecord>>> {
    let obj_rec = Box::new(ObjectEnvironmentRecord {
        bindings: global,
        outer_env: None,
        /// Object Environment Records created for with statements (13.11)
        /// can provide their binding object as an implicit this value for use in function calls.
        /// The capability is controlled by a withEnvironment Boolean value that is associated
        /// with each object Environment Record. By default, the value of withEnvironment is false
        /// for any object Environment Record.
        with_environment: false,
    });

    let dcl_rec = Box::new(DeclarativeEnvironmentRecord {
        env_rec: HashMap::new(),
        outer_env: None,
    });

    Gc::new(GcCell::new(Box::new(GlobalEnvironmentRecord {
        object_record: obj_rec,
        global_this_binding: this_value,
        declarative_record: dcl_rec,
        var_names: HashSet::new(),
    })))
}
// Similar to new_global_environment in lexical_environment, except we need to return a GlobalEnvirionment
Similar to new_global_environment in lexical_environment, except we need to return a GlobalEnvirionment
Similar to new_global_environment in lexical_environment except we need to return a GlobalEnvirionment
fn new_global_environment(
    global: Value,
    this_value: Value,
) -> Gc<GcCell<Box<GlobalEnvironmentRecord>>> {
    let obj_rec = Box::new(ObjectEnvironmentRecord {
        bindings: global,
        outer_env: None,
        /// Object Environment Records created for with statements (13.11)
        /// can provide their binding object as an implicit this value for use in function calls.
        /// The capability is controlled by a withEnvironment Boolean value that is associated
        /// with each object Environment Record. By default, the value of withEnvironment is false
        /// for any object Environment Record.
        with_environment: false,
    });
    let dcl_rec = Box::new(DeclarativeEnvironmentRecord {
        env_rec: HashMap::new(),
        outer_env: None,
    });
    Gc::new(GcCell::new(Box::new(GlobalEnvironmentRecord {
        object_record: obj_rec,
        global_this_binding: this_value,
        declarative_record: dcl_rec,
        var_names: HashSet::new(),
    })))
}
fn new_global_environment ( global : Value , this_value : Value , ) -> Gc < GcCell < Box < GlobalEnvironmentRecord > > > { let obj_rec = Box :: new ( ObjectEnvironmentRecord { bindings : global , outer_env : None , /// Object Environment Records created for with statements (13.11) /// can provide their binding object as an implicit this value for use in function calls. /// The capability is controlled by a withEnvironment Boolean value that is associated /// with each object Environment Record. By default, the value of withEnvironment is false /// for any object Environment Record. with_environment : false , } ) ; let dcl_rec = Box :: new ( DeclarativeEnvironmentRecord { env_rec : HashMap :: new ( ) , outer_env : None , } ) ; Gc :: new ( GcCell :: new ( Box :: new ( GlobalEnvironmentRecord { object_record : obj_rec , global_this_binding : this_value , declarative_record : dcl_rec , var_names : HashSet :: new ( ) , } ) ) ) }
Similar to new_global_environment in lexical_environment, except we need to return a GlobalEnvirionment
Similar to new_global_environment in lexical_environment except we need to return a GlobalEnvirionment
global
Value
this_value
Value
global
Value
this_value
Value