25 #include "interpreter.h"
26 #include "operations.h"
27 #include "bool_object.h"
28 #include "error_object.h"
37 const ClassInfo BooleanInstanceImp::info = {
"Boolean", 0, 0, 0};
39 BooleanInstanceImp::BooleanInstanceImp(ObjectImp *proto)
48 BooleanPrototypeImp::BooleanPrototypeImp(
ExecState *exec,
49 ObjectPrototypeImp *objectProto,
51 : BooleanInstanceImp(objectProto)
56 putDirect(toStringPropertyName,
new BooleanProtoFuncImp(exec,funcProto,BooleanProtoFuncImp::ToString,0,toStringPropertyName), DontEnum);
57 putDirect(valueOfPropertyName,
new BooleanProtoFuncImp(exec,funcProto,BooleanProtoFuncImp::ValueOf,0,valueOfPropertyName), DontEnum);
58 setInternalValue(
Boolean(
false));
64 BooleanProtoFuncImp::BooleanProtoFuncImp(
ExecState * ,
69 putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
74 bool BooleanProtoFuncImp::implementsCall()
const
84 KJS_CHECK_THIS( BooleanInstanceImp, thisObj );
100 BooleanPrototypeImp *booleanProto)
104 putDirect(prototypePropertyName, booleanProto, DontEnum|DontDelete|ReadOnly);
107 putDirect(lengthPropertyName, NumberImp::one(), ReadOnly|DontDelete|DontEnum);
111 bool BooleanObjectImp::implementsConstruct()
const
123 b = args.
begin()->dispatchToBoolean(exec);
127 obj.setInternalValue(b);
132 bool BooleanObjectImp::implementsCall()
const
143 return Boolean(args[0].toBoolean(exec));