Changeset 15482 in webkit for trunk/JavaScriptCore/API/minidom.c


Ignore:
Timestamp:
Jul 17, 2006, 1:20:28 AM (19 years ago)
Author:
ggaren
Message:

Reviewed by Maciej.


  • Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback, to match JSObjectMakeFunctionWithCallback.


  • Added prototype parameter, so the generated constructor automatically works with hasInstance / instanceof


  • Moved hasInstance implementation from InternalFunctionImp to JSObject so that subclasses can inherit it without inheriting function-related baggage. More refactoring here would be good, but this seems like a good short-term solution.

(KJS::JSCallbackFunction::implementsHasInstance): override and return false,
because callback functions aren't constructors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/minidom.c

    r15481 r15482  
    4545   
    4646    JSStringRef node = JSStringCreateWithUTF8CString("Node");
    47     JSObjectSetProperty(context, globalObject, node, JSObjectMakeConstructor(context, JSNode_construct), kJSPropertyAttributeNone, NULL);
     47    JSObjectSetProperty(context, globalObject, node, JSObjectMakeConstructorWithCallback(context, JSNode_prototype(context), JSNode_construct), kJSPropertyAttributeNone, NULL);
    4848    JSStringRelease(node);
    4949   
Note: See TracChangeset for help on using the changeset viewer.