parameters: (type, descriptorProvider, templateValues)
return_statement: return string.Template(wrap).substitute(defaultValues, **templateValues)
docstring: Reflect a C++ value of IDL type "type" into JS.  TemplateValues is a dict
      that should contain:
  
        * 'jsvalRef': something that can have .address() called on it to get a
                      JS::Value* and .set() called on it to set it to a JS::Value.
                      This can be a JS::MutableHandle<JS::Value> or a
                      JS::Rooted<JS::Value>.
        * 'jsvalHandle': something that can be passed to methods taking a
                         JS::MutableHandle<JS::Value>.  This can be a
                         JS::MutableHandle<JS::Value> or a JS::Rooted<JS::Value>*.
        * 'obj' (optional): the name of the variable that contains the JSObject to
                            use as a scope when wrapping, if not supplied 'obj'
                            will be used as the name
        * 'result' (optional): the name of the variable in which the C++ value is
                               stored, if not supplied 'result' will be used as
                               the name
        * 'successCode' (optional): the code to run once we have successfully
                                    done the conversion, if not supplied 'return
                                    true;' will be used as the code.  The
                                    successCode must ensure that once it runs no
                                    more of the conversion template will be
                                    executed (e.g. by doing a 'return' or 'break'
                                    as appropriate).
        * 'returnsNewObject' (optional): If true, we're wrapping for the return
                                         value of a [NewObject] method.  Assumed
                                         false if not set.
        * 'exceptionCode' (optional): Code to run when a JS exception is thrown.
                                      The default is "return false;".  The code
                                      passed here must return.
docstring_summary: Reflect a C++ value of IDL type "type" into JS.  TemplateValues is a dict
      that should contain:
docstring_tokens: Reflect a C ++ value of IDL type type into JS . TemplateValues is a dict that should contain :
function: def wrapForType(type, descriptorProvider, templateValues):
      """
      Reflect a C++ value of IDL type "type" into JS.  TemplateValues is a dict
      that should contain:
  
        * 'jsvalRef': something that can have .address() called on it to get a
                      JS::Value* and .set() called on it to set it to a JS::Value.
                      This can be a JS::MutableHandle<JS::Value> or a
                      JS::Rooted<JS::Value>.
        * 'jsvalHandle': something that can be passed to methods taking a
                         JS::MutableHandle<JS::Value>.  This can be a
                         JS::MutableHandle<JS::Value> or a JS::Rooted<JS::Value>*.
        * 'obj' (optional): the name of the variable that contains the JSObject to
                            use as a scope when wrapping, if not supplied 'obj'
                            will be used as the name
        * 'result' (optional): the name of the variable in which the C++ value is
                               stored, if not supplied 'result' will be used as
                               the name
        * 'successCode' (optional): the code to run once we have successfully
                                    done the conversion, if not supplied 'return
                                    true;' will be used as the code.  The
                                    successCode must ensure that once it runs no
                                    more of the conversion template will be
                                    executed (e.g. by doing a 'return' or 'break'
                                    as appropriate).
        * 'returnsNewObject' (optional): If true, we're wrapping for the return
                                         value of a [NewObject] method.  Assumed
                                         false if not set.
        * 'exceptionCode' (optional): Code to run when a JS exception is thrown.
                                      The default is "return false;".  The code
                                      passed here must return.
      """
      wrap = getWrapTemplateForType(type, descriptorProvider,
                                    templateValues.get('result', 'result'),
                                    templateValues.get('successCode', None),
                                    templateValues.get('returnsNewObject', False),
                                    templateValues.get('exceptionCode',
                                                       "return false;\n"),
                                    templateValues.get('typedArraysAreStructs',
                                                       False))[0]
  
      defaultValues = {'obj': 'obj'}
      return string.Template(wrap).substitute(defaultValues, **templateValues)
function_tokens: def wrapForType ( type , descriptorProvider , templateValues ) : wrap = getWrapTemplateForType ( type , descriptorProvider , templateValues . get ( 'result' , 'result' ) , templateValues . get ( 'successCode' , None ) , templateValues . get ( 'returnsNewObject' , False ) , templateValues . get ( 'exceptionCode' , "return false;\n" ) , templateValues . get ( 'typedArraysAreStructs' , False ) ) [ 0 ] defaultValues = { 'obj' : 'obj' } return string . Template ( wrap ) . substitute ( defaultValues , * * templateValues )