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/JSCallbackConstructor.h

    r15469 r15482  
    2929
    3030#include "JSObjectRef.h"
    31 #include "object.h"
     31#include <kjs/object.h>
    3232
    3333namespace KJS {
    34    
     34
    3535class JSCallbackConstructor : public JSObject
    3636{
     
    3838    JSCallbackConstructor(ExecState* exec, JSObjectCallAsConstructorCallback callback);
    3939   
     40    virtual bool implementsHasInstance() const;
     41   
    4042    virtual bool implementsConstruct() const;
    4143    virtual JSObject* construct(ExecState*, const List &args);
    42 
     44   
    4345    virtual const ClassInfo *classInfo() const { return &info; }
    4446    static const ClassInfo info;
Note: See TracChangeset for help on using the changeset viewer.