libraries/v8/runtime.cc
// This method copies structure of MaterializeClosure method above.
This method copies structure of MaterializeClosure method above.
This method copies structure of MaterializeClosure method above .
static bool SetClosureVariableValue(Isolate* isolate,
                                    Handle<Context> context,
                                    Handle<String> variable_name,
                                    Handle<Object> new_value) {
  ASSERT(context->IsFunctionContext());
  Handle<SharedFunctionInfo> shared(context->closure()->shared());
  Handle<ScopeInfo> scope_info(shared->scope_info());
  if (SetContextLocalValue(
          isolate, scope_info, context, variable_name, new_value)) {
    return true;
  }
  if (context->has_extension()) {
    Handle<JSObject> ext(JSObject::cast(context->extension()));
    if (JSReceiver::HasProperty(ext, variable_name)) {
      SetProperty(isolate,
                  ext,
                  variable_name,
                  new_value,
                  NONE,
                  kNonStrictMode);
      return true;
    }
  }
  return false;
}
static bool SetClosureVariableValue ( Isolate * isolate , Handle < Context > context , Handle < String > variable_name , Handle < Object > new_value ) { ASSERT ( context -> IsFunctionContext ( ) ) ; Handle < SharedFunctionInfo > shared ( context -> closure ( ) -> shared ( ) ) ; Handle < ScopeInfo > scope_info ( shared -> scope_info ( ) ) ; if ( SetContextLocalValue ( isolate , scope_info , context , variable_name , new_value ) ) { return true ; } if ( context -> has_extension ( ) ) { Handle < JSObject > ext ( JSObject :: cast ( context -> extension ( ) ) ) ; if ( JSReceiver :: HasProperty ( ext , variable_name ) ) { SetProperty ( isolate , ext , variable_name , new_value , NONE , kNonStrictMode ) ; return true ; } } return false ; }
This method copies structure of MaterializeClosure method above.
This method copies structure of MaterializeClosure method above .
// Context locals to the context extension. // Properties from the function context extension. This will // be variables introduced by eval. // We don't expect this to do anything except replacing property value.