Ignore:
Timestamp:
Jul 15, 2006, 6:40:07 PM (19 years ago)
Author:
ggaren
Message:

Reviewed by Maciej.


  • JSObjectMakeFunctionWithBody includes a function name and named parameters now.
  • API/JSObjectRef.cpp: (JSObjectMakeFunctionWithBody):
  • API/JSObjectRef.h:
  • API/testapi.c: (assertEqualsAsUTF8String): More informative failure reporting. (main): Test more function cases.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSObjectRef.h

    r15462 r15463  
    398398@abstract Creates a function with a given script as its body.
    399399@param context The execution context to use.
     400@param A JSString containting the function's name. Pass NULL to create an anonymous function.
     401@param parameterCount An integer count of the number of parameter names in parameterNames.
     402@param parameterNames A JSString array containing the names of the function's parameters. Pass NULL if parameterCount is 0.
    400403@param body A JSString containing the script to use as the function's body.
    401404@param sourceURL A JSString containing a URL for the script's source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions.
    402405@param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions.
    403406@param exception A pointer to a JSValueRef in which to store a syntax error exception, if any. Pass NULL if you do not care to store a syntax error exception.
    404 @result A JSObject that is an anonymous function, or NULL if body contains a syntax error. The returned object's prototype will be the default function prototype.
     407@result A JSObject that is a function, or NULL if either body or parameterNames contains a syntax error. The object's prototype will be the default function prototype.
    405408@discussion Use this method when you want to execute a script repeatedly, to avoid the cost of re-parsing the script before each execution.
    406409*/
    407 JSObjectRef JSObjectMakeFunctionWithBody(JSContextRef context, JSStringRef body, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception);
     410JSObjectRef JSObjectMakeFunctionWithBody(JSContextRef context, JSStringRef name, unsigned parameterCount, JSStringRef parameterNames[], JSStringRef body, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception);
    408411
    409412/*!
     
    521524@param thisObject The object to use as "this," or NULL to use the global object as "this."
    522525@param argumentCount An integer count of the number of arguments in arguments.
    523 @param arguments A JSValue array of the  arguments to pass to the function.
     526@param arguments A JSValue array of the  arguments to pass to the function. Pass NULL if argumentCount is 0.
    524527@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
    525528@result The JSValue that results from calling object as a function, or NULL if an exception is thrown or object is not a function.
     
    539542@param object The JSObject to call as a constructor.
    540543@param argumentCount An integer count of the number of arguments in arguments.
    541 @param arguments A JSValue array of the  arguments to pass to the function.
     544@param arguments A JSValue array of the  arguments to pass to the function. Pass NULL if argumentCount is 0.
    542545@param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
    543546@result The JSObject that results from calling object as a constructor, or NULL if an exception is thrown or object is not a constructor.
Note: See TracChangeset for help on using the changeset viewer.