Changeset 15307 in webkit for trunk/JavaScriptCore/API/JSNode.c
- Timestamp:
- Jul 10, 2006, 10:41:32 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSNode.c
r15224 r15307 40 40 // Example of throwing a type error for invalid values 41 41 if (!JSValueIsObjectOfClass(thisObject, JSNode_class(context))) { 42 JS StringBufferRef messageBuf = JSStringBufferCreateUTF8("TypeError: appendChild can only be called on nodes");42 JSInternalStringRef messageBuf = JSInternalStringCreateUTF8("TypeError: appendChild can only be called on nodes"); 43 43 JSContextSetException(context, JSStringMake(messageBuf)); 44 JS StringBufferRelease(messageBuf);44 JSInternalStringRelease(messageBuf); 45 45 } else if (argc < 1 || !JSValueIsObjectOfClass(argv[0], JSNode_class(context))) { 46 JS StringBufferRef messageBuf = JSStringBufferCreateUTF8("TypeError: first argument to appendChild must be a node");46 JSInternalStringRef messageBuf = JSInternalStringCreateUTF8("TypeError: first argument to appendChild must be a node"); 47 47 JSContextSetException(context, JSStringMake(messageBuf)); 48 JS StringBufferRelease(messageBuf);48 JSInternalStringRelease(messageBuf); 49 49 } else { 50 50 Node* node = JSObjectGetPrivate(thisObject); … … 114 114 } 115 115 116 static bool JSNode_getNodeType(JSContextRef context, JSObjectRef object, JS StringBufferRef propertyName, JSValueRef* returnValue)116 static bool JSNode_getNodeType(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* returnValue) 117 117 { 118 118 UNUSED_PARAM(context); … … 121 121 Node* node = JSObjectGetPrivate(object); 122 122 if (node) { 123 JS StringBufferRef nodeBuf = JSStringBufferCreateUTF8(node->nodeType);123 JSInternalStringRef nodeBuf = JSInternalStringCreateUTF8(node->nodeType); 124 124 *returnValue = JSStringMake(nodeBuf); 125 JS StringBufferRelease(nodeBuf);125 JSInternalStringRelease(nodeBuf); 126 126 return true; 127 127 } … … 129 129 } 130 130 131 static bool JSNode_getChildNodes(JSContextRef context, JSObjectRef thisObject, JS StringBufferRef propertyName, JSValueRef* returnValue)131 static bool JSNode_getChildNodes(JSContextRef context, JSObjectRef thisObject, JSInternalStringRef propertyName, JSValueRef* returnValue) 132 132 { 133 133 UNUSED_PARAM(propertyName); … … 138 138 } 139 139 140 static bool JSNode_getFirstChild(JSContextRef context, JSObjectRef object, JS StringBufferRef propertyName, JSValueRef* returnValue)140 static bool JSNode_getFirstChild(JSContextRef context, JSObjectRef object, JSInternalStringRef propertyName, JSValueRef* returnValue) 141 141 { 142 142 UNUSED_PARAM(context);
Note:
See TracChangeset
for help on using the changeset viewer.