Changeset 15317 in webkit for trunk/JavaScriptCore/API/JSObjectRef.h
- Timestamp:
- Jul 10, 2006, 5:26:25 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSObjectRef.h
r15310 r15317 60 60 @param context The execution context to use. 61 61 @param object The JSObject being created. 62 @param exception A pointer to a JSValueRef in which to return an exception, if any. 62 63 @discussion If you named your function Initialize, you would declare it like this: 63 64 64 void Initialize(JSContextRef context, JSObjectRef object );65 void Initialize(JSContextRef context, JSObjectRef object, JSValueRef* exception); 65 66 */ 66 67 typedef void 67 (*JSInitializeCallback) (JSContextRef context, JSObjectRef object);68 (*JSInitializeCallback) (JSContextRef context, JSObjectRef object, JSValueRef* exception); 68 69 69 70 /*! … … 76 77 */ 77 78 typedef void 78 (*JSFinalizeCallback) 79 (*JSFinalizeCallback) (JSObjectRef object); 79 80 80 81 /*! … … 84 85 @param object The JSObject to search for the property. 85 86 @param propertyName A JSInternalString containing the name of the property look up. 87 @param exception A pointer to a JSValueRef in which to return an exception, if any. 86 88 @result true if object has the property, otherwise false. 87 89 @discussion If you named your function HasProperty, you would declare it like this: 88 90 89 bool HasProperty(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName );91 bool HasProperty(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* exception); 90 92 91 93 This callback enables optimization in cases where only a property's existence needs to be known, not its value, and computing its value would be expensive. If this callback is NULL, the getProperty callback will be used to service hasProperty calls. 92 94 */ 93 95 typedef bool 94 (*JSHasPropertyCallback) (JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName);96 (*JSHasPropertyCallback) (JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* exception); 95 97 96 98 /*! … … 101 103 @param propertyName A JSInternalString containing the name of the property to get. 102 104 @param returnValue A pointer to a JSValue in which to store the property's value. 105 @param exception A pointer to a JSValueRef in which to return an exception, if any. 103 106 @result true if object has the property in question, otherwise false. If this function returns true, returnValue is assumed to contain a valid JSValue. 104 107 @discussion If you named your function GetProperty, you would declare it like this: 105 108 106 bool GetProperty(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* returnValue );109 bool GetProperty(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* returnValue, JSValueRef* exception); 107 110 108 111 If this function returns false, the get request forwards to object's static property table, then its parent class chain (which includes the default object class), then its prototype chain. 109 112 */ 110 113 typedef bool 111 (*JSGetPropertyCallback) (JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* returnValue);114 (*JSGetPropertyCallback) (JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* returnValue, JSValueRef* exception); 112 115 113 116 /*! … … 118 121 @param propertyName A JSInternalString containing the name of the property to set. 119 122 @param value A JSValue to use as the property's value. 123 @param exception A pointer to a JSValueRef in which to return an exception, if any. 120 124 @result true if the property was successfully set, otherwise false. 121 125 @discussion If you named your function SetProperty, you would declare it like this: 122 126 123 bool SetProperty(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef value );127 bool SetProperty(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef value, JSValueRef* exception); 124 128 125 129 If this function returns false, the set request forwards to object's static property table, then its parent class chain (which includes the default object class). 126 130 */ 127 131 typedef bool 128 (*JSSetPropertyCallback) (JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef value);132 (*JSSetPropertyCallback) (JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef value, JSValueRef* exception); 129 133 130 134 /*! … … 134 138 @param object The JSObject in which to delete the property. 135 139 @param propertyName A JSInternalString containing the name of the property to delete. 140 @param exception A pointer to a JSValueRef in which to return an exception, if any. 136 141 @result true if propertyName was successfully deleted, otherwise false. 137 142 @discussion If you named your function DeleteProperty, you would declare it like this: 138 143 139 bool DeleteProperty(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName );144 bool DeleteProperty(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* exception); 140 145 141 146 If this function returns false, the delete request forwards to object's static property table, then its parent class chain (which includes the default object class). 142 147 */ 143 148 typedef bool 144 (*JSDeletePropertyCallback) (JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName);149 (*JSDeletePropertyCallback) (JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* exception); 145 150 146 151 /*! … … 150 155 @param object The JSObject whose properties need to be added to propertyList. 151 156 @param propertyList A JavaScript property list that will be used to enumerate object's properties. 157 @param exception A pointer to a JSValueRef in which to return an exception, if any. 152 158 @discussion If you named your function GetPropertyList, you would declare it like this: 153 159 154 void GetPropertyList(JSContextRef context, JSObjectRef object, JSPropertyListRef propertyList );160 void GetPropertyList(JSContextRef context, JSObjectRef object, JSPropertyListRef propertyList, JSValueRef* exception); 155 161 156 162 Use JSPropertyListAdd to add properties to propertyList. … … 159 165 */ 160 166 typedef void 161 (*JSGetPropertyListCallback) (JSContextRef context, JSObjectRef object, JSPropertyListRef propertyList);167 (*JSGetPropertyListCallback) (JSContextRef context, JSObjectRef object, JSPropertyListRef propertyList, JSValueRef* exception); 162 168 163 169 /*! … … 169 175 @param argc An integer count of the number of arguments in argv. 170 176 @param argv A JSValue array of the arguments passed to the function. 177 @param exception A pointer to a JSValueRef in which to return an exception, if any. 171 178 @result A JSValue that is the function's return value. 172 179 @discussion If you named your function CallAsFunction, you would declare it like this: 173 180 174 JSValueRef CallAsFunction(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, JSValueRef argv[] );181 JSValueRef CallAsFunction(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, JSValueRef argv[], JSValueRef* exception); 175 182 176 183 If your callback were invoked by the JavaScript expression 'myObject.myMemberFunction()', function would be set to myMemberFunction, and thisObject would be set to myObject. … … 179 186 */ 180 187 typedef JSValueRef 181 (*JSCallAsFunctionCallback) (JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, JSValueRef argv[]);188 (*JSCallAsFunctionCallback) (JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argc, JSValueRef argv[], JSValueRef* exception); 182 189 183 190 /*! … … 188 195 @param argc An integer count of the number of arguments in argv. 189 196 @param argv A JSValue array of the arguments passed to the function. 197 @param exception A pointer to a JSValueRef in which to return an exception, if any. 190 198 @result A JSObject that is the constructor's return value. 191 199 @discussion If you named your function CallAsConstructor, you would declare it like this: 192 200 193 JSObjectRef CallAsConstructor(JSContextRef context, JSObjectRef constructor, size_t argc, JSValueRef argv[] );201 JSObjectRef CallAsConstructor(JSContextRef context, JSObjectRef constructor, size_t argc, JSValueRef argv[], JSValueRef* exception); 194 202 195 203 If your callback were invoked by the JavaScript expression 'new myConstructorFunction()', constructor would be set to myConstructorFunction. … … 198 206 */ 199 207 typedef JSObjectRef 200 (*JSCallAsConstructorCallback) (JSContextRef context, JSObjectRef constructor, size_t argc, JSValueRef argv[]);208 (*JSCallAsConstructorCallback) (JSContextRef context, JSObjectRef constructor, size_t argc, JSValueRef argv[], JSValueRef* exception); 201 209 202 210 /*! … … 207 215 @param typeCode A JSTypeCode specifying the JavaScript type to convert to. 208 216 @param returnValue A pointer to a JSValue in which to store the converted value. 217 @param exception A pointer to a JSValueRef in which to return an exception, if any. 209 218 @result true if the value was converted, otherwise false. If this function returns true, returnValue is assumed to contain a valid JSValue. 210 219 @discussion If you named your function ConvertToType, you would declare it like this: 211 220 212 bool ConvertToType(JSContextRef context, JSObjectRef object, JSTypeCode typeCode, JSValueRef* returnValue );221 bool ConvertToType(JSContextRef context, JSObjectRef object, JSTypeCode typeCode, JSValueRef* returnValue, JSValueRef* exception); 213 222 214 223 If this function returns false, the conversion request forwards to object's parent class chain (which includes the default object class). 215 224 */ 216 225 typedef bool 217 (*JSConvertToTypeCallback) (JSContextRef context, JSObjectRef object, JSTypeCode typeCode, JSValueRef* returnValue);226 (*JSConvertToTypeCallback) (JSContextRef context, JSObjectRef object, JSTypeCode typeCode, JSValueRef* returnValue, JSValueRef* exception); 218 227 219 228 /*!
Note:
See TracChangeset
for help on using the changeset viewer.