Changeset 15376 in webkit for trunk/JavaScriptCore/API/JSValueRef.h
- Timestamp:
- Jul 12, 2006, 1:12:08 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSValueRef.h
r15328 r15376 30 30 #include <JavaScriptCore/JSBase.h> 31 31 32 /*! 33 @enum JSTypeCode 32 #include <stdbool.h> 33 34 /*! 35 @enum JSType 34 36 @abstract A constant identifying the type of a JSValue. 35 37 @constant kJSTypeUndefined The unique undefined value. … … 47 49 kJSTypeString, 48 50 kJSTypeObject 49 } JSType Code;51 } JSType; 50 52 51 53 #ifdef __cplusplus … … 55 57 /*! 56 58 @function 57 @abstract Returns a JavaScript value's type code.59 @abstract Returns a JavaScript value's type. 58 60 @param value The JSValue whose type you want to obtain. 59 @result A value of type JSType Codethat identifies value's type.60 */ 61 JSType CodeJSValueGetType(JSValueRef value);61 @result A value of type JSType that identifies value's type. 62 */ 63 JSType JSValueGetType(JSValueRef value); 62 64 63 65 /*! … … 151 153 by the JS instanceof operator, otherwise false. 152 154 */ 153 bool JSValueIsInstanceOf (JSContextRef context, JSValueRef value, JSObjectRef constructor);155 bool JSValueIsInstanceOfConstructor(JSContextRef context, JSValueRef value, JSObjectRef constructor); 154 156 155 157 // Creating values … … 160 162 @result The unique undefined value. 161 163 */ 162 JSValueRef JS UndefinedMake(void);164 JSValueRef JSValueMakeUndefined(void); 163 165 164 166 /*! … … 167 169 @result The unique null value. 168 170 */ 169 JSValueRef JS NullMake(void);171 JSValueRef JSValueMakeNull(void); 170 172 171 173 /*! 172 174 @function 173 175 @abstract Creates a JavaScript value of the boolean type. 174 @param value The boolean valueto assign to the newly created JSValue.175 @result A JSValue of the boolean type, representing the boolean value of value.176 */ 177 178 JSValueRef JS BooleanMake(bool value);176 @param boolean The bool to assign to the newly created JSValue. 177 @result A JSValue of the boolean type, representing the value of boolean. 178 */ 179 180 JSValueRef JSValueMakeBoolean(bool boolean); 179 181 180 182 /*! 181 183 @function 182 184 @abstract Creates a JavaScript value of the number type. 183 @param value The numeric value to assign to the newly created JSValue.184 @result A JSValue of the number type, representing the numeric value of value.185 */ 186 JSValueRef JS NumberMake(double value);185 @param number The double to assign to the newly created JSValue. 186 @result A JSValue of the number type, representing the value of number. 187 */ 188 JSValueRef JSValueMakeNumber(double number); 187 189 188 190 /*! 189 191 @function 190 192 @abstract Creates a JavaScript value of the string type. 191 @param string The JS InternalString to assign to the newly created JSValue. The193 @param string The JSString to assign to the newly created JSValue. The 192 194 newly created JSValue retains string, and releases it upon garbage collection. 193 @result A JSValue of the string type, representing the stringvalue of string.194 */ 195 JSValueRef JS StringMake(JSInternalStringRef string);195 @result A JSValue of the string type, representing the value of string. 196 */ 197 JSValueRef JSValueMakeString(JSStringRef string); 196 198 197 199 // Converting to primitive values … … 217 219 /*! 218 220 @function 219 @abstract Converts a JavaScript value to string and copies the resulting 220 string into a newly allocated JavaScript string. 221 @param context The execution context to use. 222 @param value The JSValue to convert. 223 @result A JSInternalString containing the result of conversion, or an empty 224 string if conversion fails. Ownership follows the copy rule. 225 */ 226 JSInternalStringRef JSValueCopyStringValue(JSContextRef context, JSValueRef value); 221 @abstract Converts a JavaScript value to string and copies the result into a JavaScript string. 222 @param context The execution context to use. 223 @param value The JSValue to convert. 224 @result A JSString with the result of conversion, or an empty string if conversion fails. Ownership follows the Create Rule. 225 */ 226 JSStringRef JSValueToStringCopy(JSContextRef context, JSValueRef value); 227 227 228 228 /*! … … 243 243 equal number of times before becoming eligible for garbage collection. 244 244 */ 245 void JS GCProtect(JSValueRef value);245 void JSValueProtect(JSValueRef value); 246 246 247 247 /*! … … 252 252 equal number of times before becoming eligible for garbage collection. 253 253 */ 254 void JS GCUnprotect(JSValueRef value);254 void JSValueUnprotect(JSValueRef value); 255 255 256 256 /*! … … 258 258 @abstract Performs a JavaScript garbage collection. 259 259 @discussion JavaScript values that are on the machine stack, in a register, 260 protected by JSGCProtect, set as the global object of an execution context, or reachable from any such 261 value will not be collected. It is not normally necessary to call this function 262 directly; the JS runtime will garbage collect as needed. 263 */ 264 void JSGCCollect(void); 260 protected by JSValueProtect, set as the global object of an execution context, 261 or reachable from any such value will not be collected. 262 263 You are not required to call this function; the JavaScript engine will garbage 264 collect as needed. 265 */ 266 void JSGarbageCollect(void); 265 267 266 268 #ifdef __cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.