parameters: (idl_type, extended_attributes, v8_value, variable_name, index=None, declare_variable=True, isolate='info.GetIsolate()', bailout_return_value=None, use_exception_state=False, restricted_float=False)
return_statement: return {
          'assign_expression': assign_expression,
          'check_expression': check_expression,
          'cpp_type': this_cpp_type,
          'cpp_name': variable_name,
          'declare_variable': declare_variable,
          'return_expression': bailout_return_value,
          'set_expression': set_expression,
      }
docstring: Returns an expression that converts a V8 value to a C++ value and stores it as a local value.
docstring_summary: Returns an expression that converts a V8 value to a C++ value and stores it as a local value.
docstring_tokens: Returns an expression that converts a V8 value to a C ++ value and stores it as a local value .
function: def v8_value_to_local_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index=None, declare_variable=True, isolate='info.GetIsolate()', bailout_return_value=None, use_exception_state=False, restricted_float=False):
      """Returns an expression that converts a V8 value to a C++ value and stores it as a local value."""
  
      this_cpp_type = idl_type.cpp_type_args(extended_attributes=extended_attributes, raw_type=True)
      idl_type = idl_type.preprocessed_type
  
      cpp_value = v8_value_to_cpp_value(idl_type, extended_attributes, v8_value, variable_name, index, isolate, restricted_float=restricted_float)
  
      # Optional expression that returns a value to be assigned to the local variable.
      assign_expression = None
      # Optional void expression executed unconditionally.
      set_expression = None
      # Optional expression that returns true if the conversion fails.
      check_expression = None
      # Optional expression used as the return value when returning. Only
      # meaningful if 'check_expression' is not None.
      return_expression = bailout_return_value
  
      if idl_type.is_string_type or idl_type.v8_conversion_needs_exception_state:
          # Types for which conversion can fail and that need error handling.
  
          if use_exception_state:
              check_expression = 'exceptionState.hadException()'
          else:
              check_expression = 'exceptionState.throwIfNeeded()'
  
          if idl_type.is_dictionary or idl_type.is_union_type:
              set_expression = cpp_value
          else:
              assign_expression = cpp_value
              # Note: 'not idl_type.v8_conversion_needs_exception_state' implies
              # 'idl_type.is_string_type', but there are types for which both are
              # true (ByteString and USVString), so using idl_type.is_string_type
              # as the condition here would be wrong.
              if not idl_type.v8_conversion_needs_exception_state:
                  if use_exception_state:
                      check_expression = '!%s.prepare(exceptionState)' % variable_name
                  else:
                      check_expression = '!%s.prepare()' % variable_name
      elif not idl_type.v8_conversion_is_trivial:
          return {
              'error_message': 'no V8 -> C++ conversion for IDL type: %s' % idl_type.name
          }
      else:
          assign_expression = cpp_value
  
      # Types that don't need error handling, and simply assign a value to the
      # local variable.
  
      return {
          'assign_expression': assign_expression,
          'check_expression': check_expression,
          'cpp_type': this_cpp_type,
          'cpp_name': variable_name,
          'declare_variable': declare_variable,
          'return_expression': bailout_return_value,
          'set_expression': set_expression,
      }
function_tokens: def v8_value_to_local_cpp_value ( idl_type , extended_attributes , v8_value , variable_name , index = None , declare_variable = True , isolate = 'info.GetIsolate()' , bailout_return_value = None , use_exception_state = False , restricted_float = False ) : this_cpp_type = idl_type . cpp_type_args ( extended_attributes = extended_attributes , raw_type = True ) idl_type = idl_type . preprocessed_type cpp_value = v8_value_to_cpp_value ( idl_type , extended_attributes , v8_value , variable_name , index , isolate , restricted_float = restricted_float ) # Optional expression that returns a value to be assigned to the local variable. assign_expression = None # Optional void expression executed unconditionally. set_expression = None # Optional expression that returns true if the conversion fails. check_expression = None # Optional expression used as the return value when returning. Only # meaningful if 'check_expression' is not None. return_expression = bailout_return_value if idl_type . is_string_type or idl_type . v8_conversion_needs_exception_state : # Types for which conversion can fail and that need error handling. if use_exception_state : check_expression = 'exceptionState.hadException()' else : check_expression = 'exceptionState.throwIfNeeded()' if idl_type . is_dictionary or idl_type . is_union_type : set_expression = cpp_value else : assign_expression = cpp_value # Note: 'not idl_type.v8_conversion_needs_exception_state' implies # 'idl_type.is_string_type', but there are types for which both are # true (ByteString and USVString), so using idl_type.is_string_type # as the condition here would be wrong. if not idl_type . v8_conversion_needs_exception_state : if use_exception_state : check_expression = '!%s.prepare(exceptionState)' % variable_name else : check_expression = '!%s.prepare()' % variable_name elif not idl_type . v8_conversion_is_trivial : return { 'error_message' : 'no V8 -> C++ conversion for IDL type: %s' % idl_type . name } else : assign_expression = cpp_value # Types that don't need error handling, and simply assign a value to the # local variable. return { 'assign_expression' : assign_expression , 'check_expression' : check_expression , 'cpp_type' : this_cpp_type , 'cpp_name' : variable_name , 'declare_variable' : declare_variable , 'return_expression' : bailout_return_value , 'set_expression' : set_expression , }