Ignore:
Timestamp:
Jul 16, 2006, 7:00:40 PM (19 years ago)
Author:
ggaren
Message:

Reviewed by Maciej.


  • Change getProperty* to return undefined, rather than NULL, for missing properties, since that's what the spec says. Also added exception out parameters to the *Index functions, because they can call through to the regular functions, which can throw for custom objects.
  • API/JSObjectRef.cpp: (JSObjectGetProperty): (JSObjectGetPropertyAtIndex): (JSObjectSetPropertyAtIndex):
  • API/JSObjectRef.h:
  • API/testapi.c: (main):
File:
1 edited

Legend:

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

    r15473 r15474  
    448448@param propertyName A JSString containing the property's name.
    449449@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.
    450 @result The property's value if object has the property, otherwise NULL.
     450@result The property's value if object has the property, otherwise the undefined value.
    451451*/
    452452JSValueRef JSObjectGetProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
     
    481481@param object The JSObject whose property you want to get.
    482482@param propertyIndex The property's name as a number
    483 @result The property's value if object has the property, otherwise NULL.
    484 @discussion This is equivalent to getting a property by a string name containing the number, but allows faster access to JS arrays.
    485 */
    486 JSValueRef JSObjectGetPropertyAtIndex(JSContextRef context, JSObjectRef object, unsigned propertyIndex);
     483@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.
     484@result The property's value if object has the property, otherwise the undefined value.
     485@discussion Calling JSObjectGetPropertyAtIndex is equivalent to calling JSObjectGetProperty with a string containing propertyIndex, but it enables optimized access to JavaScript arrays.
     486*/
     487JSValueRef JSObjectGetPropertyAtIndex(JSContextRef context, JSObjectRef object, unsigned propertyIndex, JSValueRef* exception);
    487488
    488489/*!
     
    493494@param propertyIndex The property's name as a number
    494495@param value A JSValue to use as the property's value.
    495 @discussion This is equivalent to setting a property by a string name containing the number, but allows faster access to JS arrays.
    496 */
    497 void JSObjectSetPropertyAtIndex(JSContextRef context, JSObjectRef object, unsigned propertyIndex, JSValueRef value);
     496@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.
     497@discussion Calling JSObjectSetPropertyAtIndex is equivalent to calling JSObjectSetProperty with a string containing propertyIndex, but it enables optimized access to JavaScript arrays.
     498*/
     499void JSObjectSetPropertyAtIndex(JSContextRef context, JSObjectRef object, unsigned propertyIndex, JSValueRef value, JSValueRef* exception);
    498500
    499501/*!
Note: See TracChangeset for help on using the changeset viewer.