Changeset 15328 in webkit for trunk/JavaScriptCore/API/JSNode.c
- Timestamp:
- Jul 10, 2006, 10:37:00 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSNode.c
r15317 r15328 40 40 // Example of throwing a type error for invalid values 41 41 if (!JSValueIsObjectOfClass(thisObject, JSNode_class(context))) { 42 JSInternalStringRef message Buf= JSInternalStringCreateUTF8("TypeError: appendChild can only be called on nodes");43 *exception = JSStringMake(message Buf);44 JSInternalStringRelease(message Buf);42 JSInternalStringRef message = JSInternalStringCreateUTF8("TypeError: appendChild can only be called on nodes"); 43 *exception = JSStringMake(message); 44 JSInternalStringRelease(message); 45 45 } else if (argc < 1 || !JSValueIsObjectOfClass(argv[0], JSNode_class(context))) { 46 JSInternalStringRef message Buf= JSInternalStringCreateUTF8("TypeError: first argument to appendChild must be a node");47 *exception = JSStringMake(message Buf);48 JSInternalStringRelease(message Buf);46 JSInternalStringRef message = JSInternalStringCreateUTF8("TypeError: first argument to appendChild must be a node"); 47 *exception = JSStringMake(message); 48 JSInternalStringRelease(message); 49 49 } else { 50 50 Node* node = JSObjectGetPrivate(thisObject); … … 121 121 Node* node = JSObjectGetPrivate(object); 122 122 if (node) { 123 JSInternalStringRef node Buf= JSInternalStringCreateUTF8(node->nodeType);124 *returnValue = JSStringMake(node Buf);125 JSInternalStringRelease(node Buf);123 JSInternalStringRef nodeType = JSInternalStringCreateUTF8(node->nodeType); 124 *returnValue = JSStringMake(nodeType); 125 JSInternalStringRelease(nodeType); 126 126 return true; 127 127 }
Note:
See TracChangeset
for help on using the changeset viewer.