Changeset 11527 in webkit for trunk/JavaScriptCore/kjs/bool_object.cpp
- Timestamp:
- Dec 10, 2005, 6:06:17 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/bool_object.cpp
r11525 r11527 34 34 using namespace KJS; 35 35 36 // ------------------------------ BooleanInstance Imp---------------------------36 // ------------------------------ BooleanInstance --------------------------- 37 37 38 const ClassInfo BooleanInstance Imp::info = {"Boolean", 0, 0, 0};38 const ClassInfo BooleanInstance::info = {"Boolean", 0, 0, 0}; 39 39 40 BooleanInstance Imp::BooleanInstanceImp(ObjectImp*proto)41 : ObjectImp(proto)40 BooleanInstance::BooleanInstance(JSObject *proto) 41 : JSObject(proto) 42 42 { 43 43 } 44 44 45 // ------------------------------ BooleanPrototype Imp--------------------------45 // ------------------------------ BooleanPrototype -------------------------- 46 46 47 47 // ECMA 15.6.4 48 48 49 BooleanPrototype Imp::BooleanPrototypeImp(ExecState *exec,50 ObjectPrototype Imp*objectProto,51 FunctionPrototype Imp*funcProto)52 : BooleanInstance Imp(objectProto)49 BooleanPrototype::BooleanPrototype(ExecState *exec, 50 ObjectPrototype *objectProto, 51 FunctionPrototype *funcProto) 52 : BooleanInstance(objectProto) 53 53 { 54 54 // The constructor will be added later by InterpreterImp::InterpreterImp() 55 55 56 putDirect(toStringPropertyName, new BooleanProtoFunc Imp(exec,funcProto,BooleanProtoFuncImp::ToString,0), DontEnum);57 putDirect(valueOfPropertyName, new BooleanProtoFunc Imp(exec,funcProto,BooleanProtoFuncImp::ValueOf,0), DontEnum);56 putDirect(toStringPropertyName, new BooleanProtoFunc(exec,funcProto,BooleanProtoFunc::ToString,0), DontEnum); 57 putDirect(valueOfPropertyName, new BooleanProtoFunc(exec,funcProto,BooleanProtoFunc::ValueOf,0), DontEnum); 58 58 setInternalValue(jsBoolean(false)); 59 59 } 60 60 61 61 62 // ------------------------------ BooleanProtoFunc Imp--------------------------62 // ------------------------------ BooleanProtoFunc -------------------------- 63 63 64 BooleanProtoFunc Imp::BooleanProtoFuncImp(ExecState *exec,65 FunctionPrototype Imp*funcProto, int i, int len)64 BooleanProtoFunc::BooleanProtoFunc(ExecState *exec, 65 FunctionPrototype *funcProto, int i, int len) 66 66 : InternalFunctionImp(funcProto), id(i) 67 67 { … … 70 70 71 71 72 bool BooleanProtoFunc Imp::implementsCall() const72 bool BooleanProtoFunc::implementsCall() const 73 73 { 74 74 return true; … … 77 77 78 78 // ECMA 15.6.4.2 + 15.6.4.3 79 ValueImp *BooleanProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp*thisObj, const List &/*args*/)79 JSValue *BooleanProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &/*args*/) 80 80 { 81 81 // no generic function. "this" has to be a Boolean object 82 if (!thisObj->inherits(&BooleanInstance Imp::info))82 if (!thisObj->inherits(&BooleanInstance::info)) 83 83 return throwError(exec, TypeError); 84 84 85 85 // execute "toString()" or "valueOf()", respectively 86 86 87 ValueImp*v = thisObj->internalValue();87 JSValue *v = thisObj->internalValue(); 88 88 assert(v); 89 89 … … 96 96 97 97 98 BooleanObjectImp::BooleanObjectImp(ExecState *exec, FunctionPrototype Imp*funcProto,99 BooleanPrototype Imp*booleanProto)98 BooleanObjectImp::BooleanObjectImp(ExecState *exec, FunctionPrototype *funcProto, 99 BooleanPrototype *booleanProto) 100 100 : InternalFunctionImp(funcProto) 101 101 { … … 113 113 114 114 // ECMA 15.6.2 115 ObjectImp*BooleanObjectImp::construct(ExecState *exec, const List &args)115 JSObject *BooleanObjectImp::construct(ExecState *exec, const List &args) 116 116 { 117 ObjectImp *obj(new BooleanInstanceImp(exec->lexicalInterpreter()->builtinBooleanPrototype()));117 JSObject *obj(new BooleanInstance(exec->lexicalInterpreter()->builtinBooleanPrototype())); 118 118 119 119 bool b; … … 134 134 135 135 // ECMA 15.6.1 136 ValueImp *BooleanObjectImp::callAsFunction(ExecState *exec, ObjectImp*/*thisObj*/, const List &args)136 JSValue *BooleanObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args) 137 137 { 138 138 if (args.isEmpty())
Note:
See TracChangeset
for help on using the changeset viewer.