26 #include "interpreter.h"
27 #include "operations.h"
28 #include "bool_object.h"
29 #include "error_object.h"
38 const ClassInfo BooleanInstanceImp::info = {
"Boolean", 0, 0, 0};
40 BooleanInstanceImp::BooleanInstanceImp(ObjectImp *proto)
49 BooleanPrototypeImp::BooleanPrototypeImp(
ExecState *exec,
50 ObjectPrototypeImp *objectProto,
52 : BooleanInstanceImp(objectProto)
57 putDirect(toStringPropertyName,
new BooleanProtoFuncImp(exec,funcProto,BooleanProtoFuncImp::ToString,0,toStringPropertyName), DontEnum);
58 putDirect(valueOfPropertyName,
new BooleanProtoFuncImp(exec,funcProto,BooleanProtoFuncImp::ValueOf,0,valueOfPropertyName), DontEnum);
59 setInternalValue(
Boolean(
false));
65 BooleanProtoFuncImp::BooleanProtoFuncImp(
ExecState * ,
70 putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
75 bool BooleanProtoFuncImp::implementsCall()
const
85 KJS_CHECK_THIS( BooleanInstanceImp, thisObj );
101 BooleanPrototypeImp *booleanProto)
105 putDirect(prototypePropertyName, booleanProto, DontEnum|DontDelete|ReadOnly);
108 putDirect(lengthPropertyName, NumberImp::one(), ReadOnly|DontDelete|DontEnum);
112 bool BooleanObjectImp::implementsConstruct()
const
124 b = args.
begin()->dispatchToBoolean(exec);
128 obj.setInternalValue(b);
133 bool BooleanObjectImp::implementsCall()
const
144 return Boolean(args[0].toBoolean(exec));