JavaScriptCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Dec 2005 00:38:07 +0000 (00:38 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Dec 2005 00:38:07 +0000 (00:38 +0000)
        Reviewed by Maciej.

        - eliminated the old Undefined(), Null(), Boolean(), Number(), and String()

        Code now uses jsUndefined(), jsNull(), jsBoolean(), jsNumber(), and jsString().

        * bindings/NP_jsobject.cpp:
        (_NPN_Evaluate):
        * bindings/c/c_instance.cpp:
        (KJS::Bindings::CInstance::invokeMethod):
        (KJS::Bindings::CInstance::invokeDefaultMethod):
        * bindings/c/c_runtime.cpp:
        (CField::valueFromInstance):
        * bindings/c/c_utility.cpp:
        (KJS::Bindings::convertNPVariantToValue):
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeMethod):
        (JavaInstance::invokeDefaultMethod):
        * bindings/jni/jni_jsobject.cpp:
        (JSObject::eval):
        (JSObject::convertJObjectToValue):
        * bindings/jni/jni_runtime.cpp:
        (JavaArray::convertJObjectToArray):
        (JavaField::valueFromInstance):
        (JavaArray::valueAt):
        * bindings/objc/WebScriptObject.mm:
        (-[WebScriptObject callWebScriptMethod:withArguments:]):
        (-[WebScriptObject evaluateWebScript:]):
        (-[WebScriptObject valueForKey:]):
        (-[WebScriptObject webScriptValueAtIndex:]):
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::invokeMethod):
        (ObjcInstance::invokeDefaultMethod):
        (ObjcInstance::getValueOfUndefinedField):
        * bindings/objc/objc_runtime.mm:
        (ObjcField::valueFromInstance):
        (ObjcFallbackObjectImp::callAsFunction):
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertNSStringToString):
        (KJS::Bindings::convertObjcValueToValue):
        * bindings/runtime.h:
        (KJS::Bindings::Class::fallbackObject):
        (KJS::Bindings::Instance::getValueOfUndefinedField):
        (KJS::Bindings::Instance::valueOf):
        * bindings/runtime_array.cpp:
        (RuntimeArrayImp::lengthGetter):
        * bindings/runtime_method.cpp:
        (RuntimeMethodImp::lengthGetter):
        (RuntimeMethodImp::callAsFunction):
        (RuntimeMethodImp::execute):
        * kjs/array_object.cpp:
        (ArrayInstanceImp::lengthGetter):
        (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
        (ArrayPrototypeImp::ArrayPrototypeImp):
        (ArrayProtoFuncImp::ArrayProtoFuncImp):
        (ArrayProtoFuncImp::callAsFunction):
        (ArrayObjectImp::ArrayObjectImp):
        * kjs/bool_object.cpp:
        (BooleanPrototypeImp::BooleanPrototypeImp):
        (BooleanProtoFuncImp::callAsFunction):
        (BooleanObjectImp::BooleanObjectImp):
        (BooleanObjectImp::callAsFunction):
        * kjs/error_object.cpp:
        (ErrorPrototypeImp::ErrorPrototypeImp):
        (ErrorProtoFuncImp::ErrorProtoFuncImp):
        (ErrorProtoFuncImp::callAsFunction):
        (ErrorObjectImp::ErrorObjectImp):
        (NativeErrorImp::NativeErrorImp):
        * kjs/function.cpp:
        (KJS::FunctionImp::callAsFunction):
        (KJS::FunctionImp::processParameters):
        (KJS::FunctionImp::argumentsGetter):
        (KJS::FunctionImp::lengthGetter):
        (KJS::DeclaredFunctionImp::execute):
        (KJS::encode):
        (KJS::decode):
        (KJS::GlobalFuncImp::callAsFunction):
        * kjs/function_object.cpp:
        (FunctionPrototypeImp::FunctionPrototypeImp):
        (FunctionPrototypeImp::callAsFunction):
        (FunctionProtoFuncImp::callAsFunction):
        (FunctionObjectImp::FunctionObjectImp):
        * kjs/internal.cpp:
        (KJS::InterpreterImp::initGlobalObject):
        * kjs/interpreter.h:
        * kjs/lookup.h:
        * kjs/math_object.cpp:
        (MathObjectImp::getValueProperty):
        (MathFuncImp::callAsFunction):
        * kjs/nodes.cpp:
        (Node::setExceptionDetailsIfNeeded):
        (NullNode::evaluate):
        (PropertyNode::evaluate):
        (FunctionCallBracketNode::evaluate):
        (FunctionCallDotNode::evaluate):
        (PostfixBracketNode::evaluate):
        (PostfixDotNode::evaluate):
        (VoidNode::evaluate):
        (PrefixBracketNode::evaluate):
        (PrefixDotNode::evaluate):
        (ShiftNode::evaluate):
        (valueForReadModifyAssignment):
        (AssignDotNode::evaluate):
        (AssignBracketNode::evaluate):
        (VarDeclNode::evaluate):
        (VarDeclNode::processVarDecls):
        (VarDeclListNode::evaluate):
        (ReturnNode::execute):
        (CaseClauseNode::evalStatements):
        (ParameterNode::evaluate):
        (FuncDeclNode::processFuncDecl):
        * kjs/nodes.h:
        (KJS::StatementNode::evaluate):
        * kjs/number_object.cpp:
        (NumberPrototypeImp::NumberPrototypeImp):
        (NumberProtoFuncImp::callAsFunction):
        (NumberObjectImp::NumberObjectImp):
        (NumberObjectImp::getValueProperty):
        (NumberObjectImp::callAsFunction):
        * kjs/object.cpp:
        (KJS::ObjectImp::get):
        (KJS::Error::create):
        * kjs/object_object.cpp:
        (ObjectPrototypeImp::ObjectPrototypeImp):
        (ObjectProtoFuncImp::callAsFunction):
        (ObjectObjectImp::ObjectObjectImp):
        * kjs/property_slot.cpp:
        (KJS::PropertySlot::undefinedGetter):
        * kjs/regexp_object.cpp:
        (RegExpPrototypeImp::RegExpPrototypeImp):
        (RegExpProtoFuncImp::callAsFunction):
        (RegExpObjectImp::RegExpObjectImp):
        (RegExpObjectImp::arrayOfMatches):
        (RegExpObjectImp::getBackref):
        (RegExpObjectImp::getLastMatch):
        (RegExpObjectImp::getLastParen):
        (RegExpObjectImp::getLeftContext):
        (RegExpObjectImp::getRightContext):
        (RegExpObjectImp::getValueProperty):
        (RegExpObjectImp::construct):
        * kjs/string_object.cpp:
        (StringInstanceImp::StringInstanceImp):
        (StringPrototypeImp::StringPrototypeImp):
        (replace):
        (StringProtoFuncImp::callAsFunction):
        (StringObjectImp::StringObjectImp):
        (StringObjectImp::callAsFunction):
        (StringObjectFuncImp::StringObjectFuncImp):
        (StringObjectFuncImp::callAsFunction):
        * kjs/testkjs.cpp:
        (TestFunctionImp::callAsFunction):
        (VersionFunctionImp::callAsFunction):
        * kjs/value.h:

WebCore:

        Reviewed by Maciej.

        - eliminated the old Undefined(), Null(), Boolean(), Number(), and String()

        Code now uses jsUndefined(), jsNull(), jsBoolean(), jsNumber(), and jsString().

        * khtml/ecma/domparser.cpp:
        (KJS::DOMParserProtoFunc::callAsFunction):
        * khtml/ecma/kjs_binding.cpp:
        (KJS::jsStringOrNull):
        (KJS::setDOMException):
        * khtml/ecma/kjs_binding.h:
        (KJS::DOMFunction::toPrimitive):
        * khtml/ecma/kjs_css.cpp:
        (KJS::DOMCSSStyleDeclaration::indexGetter):
        (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
        (KJS::DOMCSSStyleDeclaration::getValueProperty):
        (KJS::DOMCSSStyleDeclarationProtoFunc::callAsFunction):
        (KJS::DOMStyleSheet::getValueProperty):
        (KJS::getDOMStyleSheet):
        (KJS::DOMStyleSheetList::getValueProperty):
        (KJS::getDOMStyleSheetList):
        (KJS::DOMStyleSheetListFunc::callAsFunction):
        (KJS::DOMMediaList::getValueProperty):
        (KJS::DOMMediaList::indexGetter):
        (KJS::KJS::DOMMediaListProtoFunc::callAsFunction):
        (KJS::DOMCSSStyleSheet::getValueProperty):
        (KJS::DOMCSSStyleSheetProtoFunc::callAsFunction):
        (KJS::DOMCSSRuleList::getValueProperty):
        (KJS::DOMCSSRuleListFunc::callAsFunction):
        (KJS::DOMCSSRule::getValueProperty):
        (KJS::DOMCSSRuleFunc::callAsFunction):
        (KJS::CSSRuleConstructor::getValueProperty):
        (KJS::DOMCSSValue::getValueProperty):
        (KJS::getDOMCSSValue):
        (KJS::CSSValueConstructor::getValueProperty):
        (KJS::DOMCSSPrimitiveValue::getValueProperty):
        (KJS::DOMCSSPrimitiveValueProtoFunc::callAsFunction):
        (KJS::CSSPrimitiveValueConstructor::getValueProperty):
        (KJS::DOMCSSValueList::getValueProperty):
        (KJS::DOMCSSValueListFunc::callAsFunction):
        (KJS::DOMCounter::getValueProperty):
        * khtml/ecma/kjs_dom.cpp:
        (KJS::DOMNode::getValueProperty):
        (KJS::DOMNode::toPrimitive):
        (KJS::DOMNode::getListener):
        (KJS::DOMNodeProtoFunc::callAsFunction):
        (KJS::DOMNodeList::toPrimitive):
        (KJS::DOMNodeList::getValueProperty):
        (KJS::DOMNodeList::callAsFunction):
        (KJS::DOMAttr::getValueProperty):
        (KJS::DOMDocument::getValueProperty):
        (KJS::DOMDocumentProtoFunc::callAsFunction):
        (KJS::DOMElement::getValueProperty):
        (KJS::DOMElement::attributeGetter):
        (KJS::DOMElementProtoFunc::callAsFunction):
        (KJS::DOMDOMImplementationProtoFunc::callAsFunction):
        (KJS::DOMDocumentType::getValueProperty):
        (KJS::DOMNamedNodeMap::lengthGetter):
        (KJS::DOMNamedNodeMapProtoFunc::callAsFunction):
        (KJS::DOMProcessingInstruction::getValueProperty):
        (KJS::DOMNotation::getValueProperty):
        (KJS::DOMEntity::getValueProperty):
        (KJS::getDOMNode):
        (KJS::NodeConstructor::getValueProperty):
        (KJS::DOMExceptionConstructor::getValueProperty):
        (KJS::DOMNamedNodesCollection::lengthGetter):
        (KJS::DOMCharacterData::getValueProperty):
        (KJS::DOMCharacterDataProtoFunc::callAsFunction):
        (KJS::DOMTextProtoFunc::callAsFunction):
        * khtml/ecma/kjs_events.cpp:
        (KJS::JSLazyEventListener::parseCode):
        (KJS::EventConstructor::getValueProperty):
        (KJS::DOMEvent::getValueProperty):
        (KJS::DOMEventProtoFunc::callAsFunction):
        (KJS::getDOMEvent):
        (KJS::EventExceptionConstructor::getValueProperty):
        (KJS::DOMUIEvent::getValueProperty):
        (KJS::DOMUIEventProtoFunc::callAsFunction):
        (KJS::DOMMouseEvent::getValueProperty):
        (KJS::DOMMouseEventProtoFunc::callAsFunction):
        (KJS::DOMKeyboardEvent::getValueProperty):
        (KJS::DOMKeyboardEventProtoFunc::callAsFunction):
        (KJS::MutationEventConstructor::getValueProperty):
        (KJS::DOMMutationEvent::getValueProperty):
        (KJS::DOMMutationEventProtoFunc::callAsFunction):
        (KJS::DOMWheelEvent::getValueProperty):
        (KJS::DOMWheelEventProtoFunc::callAsFunction):
        (KJS::stringOrUndefined):
        (KJS::Clipboard::getValueProperty):
        (KJS::ClipboardProtoFunc::callAsFunction):
        * khtml/ecma/kjs_html.cpp:
        (KJS::KJS::HTMLDocFunction::callAsFunction):
        (KJS::HTMLDocument::getValueProperty):
        (KJS::HTMLElement::framesetNameGetter):
        (KJS::HTMLElement::frameWindowPropertyGetter):
        (KJS::HTMLElement::runtimeObjectPropertyGetter):
        (KJS::KJS::HTMLElement::callAsFunction):
        (KJS::HTMLElement::htmlGetter):
        (KJS::HTMLElement::headGetter):
        (KJS::HTMLElement::linkGetter):
        (KJS::HTMLElement::titleGetter):
        (KJS::HTMLElement::metaGetter):
        (KJS::HTMLElement::baseGetter):
        (KJS::HTMLElement::isIndexGetter):
        (KJS::HTMLElement::styleGetter):
        (KJS::HTMLElement::bodyGetter):
        (KJS::HTMLElement::formGetter):
        (KJS::HTMLElement::selectGetter):
        (KJS::HTMLElement::optGroupGetter):
        (KJS::HTMLElement::optionGetter):
        (KJS::getInputSelectionStart):
        (KJS::getInputSelectionEnd):
        (KJS::HTMLElement::inputGetter):
        (KJS::HTMLElement::textAreaGetter):
        (KJS::HTMLElement::buttonGetter):
        (KJS::HTMLElement::labelGetter):
        (KJS::HTMLElement::fieldSetGetter):
        (KJS::HTMLElement::legendGetter):
        (KJS::HTMLElement::uListGetter):
        (KJS::HTMLElement::oListGetter):
        (KJS::HTMLElement::dListGetter):
        (KJS::HTMLElement::dirGetter):
        (KJS::HTMLElement::menuGetter):
        (KJS::HTMLElement::liGetter):
        (KJS::HTMLElement::divGetter):
        (KJS::HTMLElement::paragraphGetter):
        (KJS::HTMLElement::headingGetter):
        (KJS::HTMLElement::blockQuoteGetter):
        (KJS::HTMLElement::quoteGetter):
        (KJS::HTMLElement::preGetter):
        (KJS::HTMLElement::brGetter):
        (KJS::HTMLElement::baseFontGetter):
        (KJS::HTMLElement::fontGetter):
        (KJS::HTMLElement::hrGetter):
        (KJS::HTMLElement::modGetter):
        (KJS::HTMLElement::anchorGetter):
        (KJS::HTMLElement::imageGetter):
        (KJS::HTMLElement::objectGetter):
        (KJS::HTMLElement::paramGetter):
        (KJS::HTMLElement::appletGetter):
        (KJS::HTMLElement::mapGetter):
        (KJS::HTMLElement::areaGetter):
        (KJS::HTMLElement::scriptGetter):
        (KJS::HTMLElement::tableGetter):
        (KJS::HTMLElement::tableCaptionGetter):
        (KJS::HTMLElement::tableColGetter):
        (KJS::HTMLElement::tableSectionGetter):
        (KJS::HTMLElement::tableRowGetter):
        (KJS::HTMLElement::tableCellGetter):
        (KJS::HTMLElement::frameSetGetter):
        (KJS::HTMLElement::frameGetter):
        (KJS::HTMLElement::iFrameGetter):
        (KJS::HTMLElement::marqueeGetter):
        (KJS::HTMLElement::getValueProperty):
        (KJS::HTMLElementFunction::HTMLElementFunction):
        (KJS::KJS::HTMLElementFunction::callAsFunction):
        (KJS::HTMLCollection::lengthGetter):
        (KJS::KJS::HTMLCollection::callAsFunction):
        (KJS::KJS::HTMLCollection::getNamedItems):
        (KJS::KJS::HTMLCollectionProtoFunc::callAsFunction):
        (KJS::HTMLSelectCollection::selectedIndexGetter):
        (KJS::HTMLSelectCollection::getOwnPropertySlot):
        (KJS::OptionConstructorImp::OptionConstructorImp):
        (KJS::Image::getValueProperty):
        (KJS::KJS::Context2DFunction::callAsFunction):
        (KJS::Context2D::getValueProperty):
        (KJS::Context2D::Context2D):
        (KJS::GradientFunction::callAsFunction):
        (KJS::Gradient::getValueProperty):
        (KJS::ImagePattern::getValueProperty):
        (KJS::getSelectHTMLCollection):
        * khtml/ecma/kjs_navigator.cpp:
        (KJS::Navigator::getValueProperty):
        (KJS::Plugins::getValueProperty):
        (KJS::Plugins::nameGetter):
        (KJS::MimeTypes::getValueProperty):
        (KJS::MimeTypes::nameGetter):
        (KJS::Plugin::getValueProperty):
        (KJS::Plugin::nameGetter):
        (KJS::MimeType::getValueProperty):
        (KJS::PluginsFunc::callAsFunction):
        (KJS::NavigatorFunc::callAsFunction):
        * khtml/ecma/kjs_proxy.cpp:
        (TestFunctionImp::callAsFunction):
        * khtml/ecma/kjs_range.cpp:
        (KJS::DOMRange::getValueProperty):
        (KJS::DOMRangeProtoFunc::callAsFunction):
        (KJS::RangeConstructor::getValueProperty):
        * khtml/ecma/kjs_traversal.cpp:
        (KJS::DOMNodeIterator::getValueProperty):
        (KJS::DOMNodeIteratorProtoFunc::callAsFunction):
        (KJS::NodeFilterConstructor::getValueProperty):
        (KJS::DOMNodeFilterProtoFunc::callAsFunction):
        (KJS::DOMTreeWalker::getValueProperty):
        (KJS::DOMTreeWalkerProtoFunc::callAsFunction):
        * khtml/ecma/kjs_views.cpp:
        (KJS::DOMAbstractViewProtoFunc::callAsFunction):
        * khtml/ecma/kjs_window.cpp:
        (KJS::Screen::getValueProperty):
        (KJS::Window::retrieve):
        (KJS::showModalDialog):
        (KJS::Window::getValueProperty):
        (KJS::Window::getListener):
        (KJS::WindowFunc::callAsFunction):
        (KJS::FrameArray::getValueProperty):
        (KJS::FrameArray::indexGetter):
        (KJS::FrameArray::nameGetter):
        (KJS::Location::getValueProperty):
        (KJS::Location::toPrimitive):
        (KJS::LocationFunc::callAsFunction):
        (KJS::Selection::getValueProperty):
        (KJS::Selection::toPrimitive):
        (KJS::SelectionFunc::callAsFunction):
        (KJS::BarInfo::getValueProperty):
        (KJS::History::getValueProperty):
        (KJS::HistoryFunc::callAsFunction):
        * khtml/ecma/xmlhttprequest.cpp:
        (KJS::XMLHttpRequest::getValueProperty):
        (KJS::XMLHttpRequest::getAllResponseHeaders):
        (KJS::XMLHttpRequest::getResponseHeader):
        (KJS::XMLHttpRequest::getStatus):
        (KJS::XMLHttpRequest::getStatusText):
        (KJS::XMLHttpRequestProtoFunc::callAsFunction):
        * khtml/ecma/xmlserializer.cpp:
        (KJS::XMLSerializerProtoFunc::callAsFunction):
        * ksvg2/ecma/Ecma.cpp:
        (KSVG::getSVGPathSeg):
        * ksvg2/ecma/GlobalObject.cpp:
        (GlobalObject::get):
        * kwq/WebCoreScriptDebugger.mm:
        (-[WebCoreScriptCallFrame evaluateWebScript:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@11525 268f45cc-cd09-0410-ab3c-d52691b4dbfc

53 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/bindings/NP_jsobject.cpp
JavaScriptCore/bindings/c/c_instance.cpp
JavaScriptCore/bindings/c/c_runtime.cpp
JavaScriptCore/bindings/c/c_utility.cpp
JavaScriptCore/bindings/jni/jni_instance.cpp
JavaScriptCore/bindings/jni/jni_jsobject.cpp
JavaScriptCore/bindings/jni/jni_runtime.cpp
JavaScriptCore/bindings/objc/WebScriptObject.mm
JavaScriptCore/bindings/objc/objc_instance.mm
JavaScriptCore/bindings/objc/objc_runtime.mm
JavaScriptCore/bindings/objc/objc_utility.mm
JavaScriptCore/bindings/runtime.h
JavaScriptCore/bindings/runtime_array.cpp
JavaScriptCore/bindings/runtime_method.cpp
JavaScriptCore/kjs/array_object.cpp
JavaScriptCore/kjs/bool_object.cpp
JavaScriptCore/kjs/error_object.cpp
JavaScriptCore/kjs/function.cpp
JavaScriptCore/kjs/function_object.cpp
JavaScriptCore/kjs/internal.cpp
JavaScriptCore/kjs/interpreter.h
JavaScriptCore/kjs/lookup.h
JavaScriptCore/kjs/math_object.cpp
JavaScriptCore/kjs/nodes.cpp
JavaScriptCore/kjs/nodes.h
JavaScriptCore/kjs/number_object.cpp
JavaScriptCore/kjs/object.cpp
JavaScriptCore/kjs/object_object.cpp
JavaScriptCore/kjs/property_slot.cpp
JavaScriptCore/kjs/regexp_object.cpp
JavaScriptCore/kjs/string_object.cpp
JavaScriptCore/kjs/testkjs.cpp
JavaScriptCore/kjs/value.h
WebCore/ChangeLog-2005-12-19
WebCore/khtml/ecma/domparser.cpp
WebCore/khtml/ecma/kjs_binding.cpp
WebCore/khtml/ecma/kjs_binding.h
WebCore/khtml/ecma/kjs_css.cpp
WebCore/khtml/ecma/kjs_dom.cpp
WebCore/khtml/ecma/kjs_events.cpp
WebCore/khtml/ecma/kjs_html.cpp
WebCore/khtml/ecma/kjs_navigator.cpp
WebCore/khtml/ecma/kjs_proxy.cpp
WebCore/khtml/ecma/kjs_range.cpp
WebCore/khtml/ecma/kjs_traversal.cpp
WebCore/khtml/ecma/kjs_views.cpp
WebCore/khtml/ecma/kjs_window.cpp
WebCore/khtml/ecma/xmlhttprequest.cpp
WebCore/khtml/ecma/xmlserializer.cpp
WebCore/ksvg2/ecma/Ecma.cpp
WebCore/ksvg2/ecma/GlobalObject.cpp
WebCore/kwq/WebCoreScriptDebugger.mm

index b8d7072..76f7d69 100644 (file)
@@ -1,3 +1,159 @@
+2005-12-10  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - eliminated the old Undefined(), Null(), Boolean(), Number(), and String()
+
+        Code now uses jsUndefined(), jsNull(), jsBoolean(), jsNumber(), and jsString().
+
+        * bindings/NP_jsobject.cpp:
+        (_NPN_Evaluate):
+        * bindings/c/c_instance.cpp:
+        (KJS::Bindings::CInstance::invokeMethod):
+        (KJS::Bindings::CInstance::invokeDefaultMethod):
+        * bindings/c/c_runtime.cpp:
+        (CField::valueFromInstance):
+        * bindings/c/c_utility.cpp:
+        (KJS::Bindings::convertNPVariantToValue):
+        * bindings/jni/jni_instance.cpp:
+        (JavaInstance::invokeMethod):
+        (JavaInstance::invokeDefaultMethod):
+        * bindings/jni/jni_jsobject.cpp:
+        (JSObject::eval):
+        (JSObject::convertJObjectToValue):
+        * bindings/jni/jni_runtime.cpp:
+        (JavaArray::convertJObjectToArray):
+        (JavaField::valueFromInstance):
+        (JavaArray::valueAt):
+        * bindings/objc/WebScriptObject.mm:
+        (-[WebScriptObject callWebScriptMethod:withArguments:]):
+        (-[WebScriptObject evaluateWebScript:]):
+        (-[WebScriptObject valueForKey:]):
+        (-[WebScriptObject webScriptValueAtIndex:]):
+        * bindings/objc/objc_instance.mm:
+        (ObjcInstance::invokeMethod):
+        (ObjcInstance::invokeDefaultMethod):
+        (ObjcInstance::getValueOfUndefinedField):
+        * bindings/objc/objc_runtime.mm:
+        (ObjcField::valueFromInstance):
+        (ObjcFallbackObjectImp::callAsFunction):
+        * bindings/objc/objc_utility.mm:
+        (KJS::Bindings::convertNSStringToString):
+        (KJS::Bindings::convertObjcValueToValue):
+        * bindings/runtime.h:
+        (KJS::Bindings::Class::fallbackObject):
+        (KJS::Bindings::Instance::getValueOfUndefinedField):
+        (KJS::Bindings::Instance::valueOf):
+        * bindings/runtime_array.cpp:
+        (RuntimeArrayImp::lengthGetter):
+        * bindings/runtime_method.cpp:
+        (RuntimeMethodImp::lengthGetter):
+        (RuntimeMethodImp::callAsFunction):
+        (RuntimeMethodImp::execute):
+        * kjs/array_object.cpp:
+        (ArrayInstanceImp::lengthGetter):
+        (CompareWithCompareFunctionArguments::CompareWithCompareFunctionArguments):
+        (ArrayPrototypeImp::ArrayPrototypeImp):
+        (ArrayProtoFuncImp::ArrayProtoFuncImp):
+        (ArrayProtoFuncImp::callAsFunction):
+        (ArrayObjectImp::ArrayObjectImp):
+        * kjs/bool_object.cpp:
+        (BooleanPrototypeImp::BooleanPrototypeImp):
+        (BooleanProtoFuncImp::callAsFunction):
+        (BooleanObjectImp::BooleanObjectImp):
+        (BooleanObjectImp::callAsFunction):
+        * kjs/error_object.cpp:
+        (ErrorPrototypeImp::ErrorPrototypeImp):
+        (ErrorProtoFuncImp::ErrorProtoFuncImp):
+        (ErrorProtoFuncImp::callAsFunction):
+        (ErrorObjectImp::ErrorObjectImp):
+        (NativeErrorImp::NativeErrorImp):
+        * kjs/function.cpp:
+        (KJS::FunctionImp::callAsFunction):
+        (KJS::FunctionImp::processParameters):
+        (KJS::FunctionImp::argumentsGetter):
+        (KJS::FunctionImp::lengthGetter):
+        (KJS::DeclaredFunctionImp::execute):
+        (KJS::encode):
+        (KJS::decode):
+        (KJS::GlobalFuncImp::callAsFunction):
+        * kjs/function_object.cpp:
+        (FunctionPrototypeImp::FunctionPrototypeImp):
+        (FunctionPrototypeImp::callAsFunction):
+        (FunctionProtoFuncImp::callAsFunction):
+        (FunctionObjectImp::FunctionObjectImp):
+        * kjs/internal.cpp:
+        (KJS::InterpreterImp::initGlobalObject):
+        * kjs/interpreter.h:
+        * kjs/lookup.h:
+        * kjs/math_object.cpp:
+        (MathObjectImp::getValueProperty):
+        (MathFuncImp::callAsFunction):
+        * kjs/nodes.cpp:
+        (Node::setExceptionDetailsIfNeeded):
+        (NullNode::evaluate):
+        (PropertyNode::evaluate):
+        (FunctionCallBracketNode::evaluate):
+        (FunctionCallDotNode::evaluate):
+        (PostfixBracketNode::evaluate):
+        (PostfixDotNode::evaluate):
+        (VoidNode::evaluate):
+        (PrefixBracketNode::evaluate):
+        (PrefixDotNode::evaluate):
+        (ShiftNode::evaluate):
+        (valueForReadModifyAssignment):
+        (AssignDotNode::evaluate):
+        (AssignBracketNode::evaluate):
+        (VarDeclNode::evaluate):
+        (VarDeclNode::processVarDecls):
+        (VarDeclListNode::evaluate):
+        (ReturnNode::execute):
+        (CaseClauseNode::evalStatements):
+        (ParameterNode::evaluate):
+        (FuncDeclNode::processFuncDecl):
+        * kjs/nodes.h:
+        (KJS::StatementNode::evaluate):
+        * kjs/number_object.cpp:
+        (NumberPrototypeImp::NumberPrototypeImp):
+        (NumberProtoFuncImp::callAsFunction):
+        (NumberObjectImp::NumberObjectImp):
+        (NumberObjectImp::getValueProperty):
+        (NumberObjectImp::callAsFunction):
+        * kjs/object.cpp:
+        (KJS::ObjectImp::get):
+        (KJS::Error::create):
+        * kjs/object_object.cpp:
+        (ObjectPrototypeImp::ObjectPrototypeImp):
+        (ObjectProtoFuncImp::callAsFunction):
+        (ObjectObjectImp::ObjectObjectImp):
+        * kjs/property_slot.cpp:
+        (KJS::PropertySlot::undefinedGetter):
+        * kjs/regexp_object.cpp:
+        (RegExpPrototypeImp::RegExpPrototypeImp):
+        (RegExpProtoFuncImp::callAsFunction):
+        (RegExpObjectImp::RegExpObjectImp):
+        (RegExpObjectImp::arrayOfMatches):
+        (RegExpObjectImp::getBackref):
+        (RegExpObjectImp::getLastMatch):
+        (RegExpObjectImp::getLastParen):
+        (RegExpObjectImp::getLeftContext):
+        (RegExpObjectImp::getRightContext):
+        (RegExpObjectImp::getValueProperty):
+        (RegExpObjectImp::construct):
+        * kjs/string_object.cpp:
+        (StringInstanceImp::StringInstanceImp):
+        (StringPrototypeImp::StringPrototypeImp):
+        (replace):
+        (StringProtoFuncImp::callAsFunction):
+        (StringObjectImp::StringObjectImp):
+        (StringObjectImp::callAsFunction):
+        (StringObjectFuncImp::StringObjectFuncImp):
+        (StringObjectFuncImp::callAsFunction):
+        * kjs/testkjs.cpp:
+        (TestFunctionImp::callAsFunction):
+        (VersionFunctionImp::callAsFunction):
+        * kjs/value.h:
+
 2005-12-10  Oliver Hunt  <ojh16@student.canterbury.ac.nz>
 
         Reviewed by Maciej, landed by Darin.
index dd4abe6..5da25ae 100644 (file)
@@ -197,11 +197,11 @@ bool _NPN_Evaluate (NPP npp, NPObject *o, NPString *s, NPVariant *variant)
         if (type == Normal) {
             result = completion.value();
             if (!result) {
-                result = Undefined();
+                result = jsUndefined();
             }
         }
         else
-            result = Undefined();
+            result = jsUndefined();
             
         free ((void *)scriptString);
         
index b6074c1..eecedc6 100644 (file)
@@ -108,7 +108,7 @@ ValueImp *CInstance::invokeMethod (ExecState *exec, const MethodList &methodList
 
     NPIdentifier ident = _NPN_GetStringIdentifier (method->name());
     if (!_object->_class->hasMethod (_object, ident)) {
-        return Undefined();
+        return jsUndefined();
     }
 
     unsigned i, count = args.size();
@@ -143,7 +143,7 @@ ValueImp *CInstance::invokeMethod (ExecState *exec, const MethodList &methodList
         return resultValue;
     }
     
-    return Undefined();
+    return jsUndefined();
 }
 
 
@@ -185,7 +185,7 @@ ValueImp *CInstance::invokeDefaultMethod (ExecState *exec, const List &args)
         }
     }
     
-    return Undefined();
+    return jsUndefined();
 }
 
 
index 53e2eec..8aa650b 100644 (file)
@@ -54,7 +54,7 @@ ValueImp *CField::valueFromInstance(ExecState *exec, const Instance *inst) const
         aValue = convertNPVariantToValue (exec, &property);
     }
     else {
-        aValue = Undefined();
+        aValue = jsUndefined();
     }
     return aValue;
 }
index c3d15c1..81642e6 100644 (file)
@@ -137,22 +137,22 @@ ValueImp *convertNPVariantToValue(ExecState *exec, const NPVariant *variant)
         return jsBoolean(false);
     }
     else if (type == NPVariantType_Null) {
-        return Null();
+        return jsNull();
     }
     else if (type == NPVariantType_Void) {
-        return Undefined();
+        return jsUndefined();
     }
     else if (type == NPVariantType_Int32) {
         int32_t anInt;
         if (NPN_VariantToInt32(variant, &anInt))
-            return Number(anInt);
-        return Number(0);
+            return jsNumber(anInt);
+        return jsNumber(0);
     }
     else if (type == NPVariantType_Double) {
         double aDouble;
         if (NPN_VariantToDouble(variant, &aDouble))
-            return Number(aDouble);
-        return Number(0);
+            return jsNumber(aDouble);
+        return jsNumber(0);
     }
     else if (type == NPVariantType_String) {
         NPUTF16 *stringValue;
@@ -176,7 +176,7 @@ ValueImp *convertNPVariantToValue(ExecState *exec, const NPVariant *variant)
         }
     }
     
-    return Undefined();
+    return jsUndefined();
 }
 
 } }
index 38d4002..9cbb187 100644 (file)
@@ -120,7 +120,7 @@ ValueImp *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodL
     }
     if (method == 0) {
         JS_LOG ("unable to find an appropiate method\n");
-        return Undefined();
+        return jsUndefined();
     }
     
     const JavaMethod *jMethod = static_cast<const JavaMethod*>(method);
@@ -154,7 +154,7 @@ ValueImp *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodL
         if (exceptionDescription) {
             throwError(exec, GeneralError, exceptionDescription->toString(exec));
             free (jArgs);
-            return Undefined();
+            return jsUndefined();
         }
     }
     
@@ -222,7 +222,7 @@ ValueImp *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodL
         
     switch (jMethod->JNIReturnType()){
         case void_type: {
-            resultValue = Undefined();
+            resultValue = jsUndefined();
         }
         break;
         
@@ -237,33 +237,33 @@ ValueImp *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodL
                 }
             }
             else {
-                resultValue = Undefined();
+                resultValue = jsUndefined();
             }
         }
         break;
         
         case boolean_type: {
-            resultValue = Boolean(result.z);
+            resultValue = jsBoolean(result.z);
         }
         break;
         
         case byte_type: {
-            resultValue = Number(result.b);
+            resultValue = jsNumber(result.b);
         }
         break;
         
         case char_type: {
-            resultValue = Number(result.c);
+            resultValue = jsNumber(result.c);
         }
         break;
         
         case short_type: {
-            resultValue = Number(result.s);
+            resultValue = jsNumber(result.s);
         }
         break;
         
         case int_type: {
-            resultValue = Number(result.i);
+            resultValue = jsNumber(result.i);
         }
         break;
         
@@ -273,18 +273,18 @@ ValueImp *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodL
         break;
         
         case float_type: {
-            resultValue = Number(result.f);
+            resultValue = jsNumber(result.f);
         }
         break;
         
         case double_type: {
-            resultValue = Number(result.d);
+            resultValue = jsNumber(result.d);
         }
         break;
 
         case invalid_type:
         default: {
-            resultValue = Undefined();
+            resultValue = jsUndefined();
         }
         break;
     }
@@ -296,7 +296,7 @@ ValueImp *JavaInstance::invokeMethod (ExecState *exec, const MethodList &methodL
 
 ValueImp *JavaInstance::invokeDefaultMethod (ExecState *exec, const List &args)
 {
-    return Undefined();
+    return jsUndefined();
 }
 
 
index ef5e9f9..8a6e849 100644 (file)
@@ -204,9 +204,9 @@ jobject JSObject::eval(jstring script) const
     if (type == Normal) {
         result = completion.value();
         if (!result)
-            result = Undefined();
+            result = jsUndefined();
     } else
-        result = Undefined();
+        result = jsUndefined();
     
     return convertValueToJObject (result);
 }
@@ -412,11 +412,11 @@ ValueImp *JSObject::convertJObjectToValue (jobject theObject) const
         JNIEnv *env = getJNIEnv();
         jfieldID fieldID = env->GetFieldID((jclass)classOfInstance, "nativeJSObject", "int");
         if (fieldID == NULL) {
-            return Undefined();
+            return jsUndefined();
         }
         jlong nativeHandle = env->GetLongField(theObject, fieldID);
         if (nativeHandle == UndefinedHandle) {
-            return Undefined();
+            return jsUndefined();
         }
         ObjectImp *imp = static_cast<ObjectImp*>(jlong_to_impptr(nativeHandle));
         return imp;
index 7806dc5..50a1870 100644 (file)
@@ -71,7 +71,7 @@ JavaField::JavaField (JNIEnv *env, jobject aField)
 ValueImp *JavaArray::convertJObjectToArray (ExecState *exec, jobject anObject, const char *type, const RootObject *r)
 {
     if (type[0] != '[')
-        return Undefined();
+        return jsUndefined();
 
     return new RuntimeArrayImp(exec, new JavaArray((jobject)anObject, type, r));
 }
@@ -108,7 +108,7 @@ ValueImp *JavaField::valueFromInstance(ExecState *exec, const Instance *i) const
 {
     const JavaInstance *instance = static_cast<const JavaInstance *>(i);
 
-    ValueImp *jsresult = Undefined();
+    ValueImp *jsresult = jsUndefined();
     
     switch (_JNIType) {
         case object_type: {
@@ -125,12 +125,9 @@ ValueImp *JavaField::valueFromInstance(ExecState *exec, const Instance *i) const
         }
         break;
             
-        case boolean_type: {
-           jvalue result = dispatchValueFromInstance (exec, instance, "getBoolean", "(Ljava/lang/Object;)Z", boolean_type);
-           jboolean value = result.z;
-            jsresult = Boolean((bool)value);
-        }
-        break;
+        case boolean_type:
+            jsresult = jsBoolean(dispatchValueFromInstance(exec, instance, "getBoolean", "(Ljava/lang/Object;)Z", boolean_type).z);
+            break;
             
         case byte_type:
         case char_type:
@@ -140,7 +137,7 @@ ValueImp *JavaField::valueFromInstance(ExecState *exec, const Instance *i) const
             jint value;
            jvalue result = dispatchValueFromInstance (exec, instance, "getInt", "(Ljava/lang/Object;)I", int_type);
            value = result.i;
-            jsresult = Number((int)value);
+            jsresult = jsNumber((int)value);
        }
        break;
 
@@ -150,7 +147,7 @@ ValueImp *JavaField::valueFromInstance(ExecState *exec, const Instance *i) const
             jdouble value;
            jvalue result = dispatchValueFromInstance (exec, instance, "getDouble", "(Ljava/lang/Object;)D", double_type);
            value = result.i;
-            jsresult = Number((double)value);
+            jsresult = jsNumber((double)value);
         }
         break;
         default:
@@ -471,7 +468,7 @@ ValueImp *JavaArray::valueAt(ExecState *exec, unsigned int index) const
 
             // No object?
             if (!anObject) {
-                return Null();
+                return jsNull();
             }
             
             // Nested array?
@@ -486,21 +483,21 @@ ValueImp *JavaArray::valueAt(ExecState *exec, unsigned int index) const
             jbooleanArray booleanArray = (jbooleanArray)javaArray();
             jboolean aBoolean;
             env->GetBooleanArrayRegion(booleanArray, index, 1, &aBoolean);
-            return Boolean (aBoolean);
+            return jsBoolean(aBoolean);
         }
             
         case byte_type: {
             jbyteArray byteArray = (jbyteArray)javaArray();
             jbyte aByte;
             env->GetByteArrayRegion(byteArray, index, 1, &aByte);
-            return Number (aByte);
+            return jsNumber(aByte);
         }
             
         case char_type: {
             jcharArray charArray = (jcharArray)javaArray();
             jchar aChar;
             env->GetCharArrayRegion(charArray, index, 1, &aChar);
-            return Number (aChar);
+            return jsNumber(aChar);
             break;
         }
             
@@ -508,40 +505,40 @@ ValueImp *JavaArray::valueAt(ExecState *exec, unsigned int index) const
             jshortArray shortArray = (jshortArray)javaArray();
             jshort aShort;
             env->GetShortArrayRegion(shortArray, index, 1, &aShort);
-            return Number (aShort);
+            return jsNumber(aShort);
         }
             
         case int_type: {
             jintArray intArray = (jintArray)javaArray();
             jint anInt;
             env->GetIntArrayRegion(intArray, index, 1, &anInt);
-            return Number (anInt);
+            return jsNumber(anInt);
         }
             
         case long_type: {
             jlongArray longArray = (jlongArray)javaArray();
             jlong aLong;
             env->GetLongArrayRegion(longArray, index, 1, &aLong);
-            return Number ((long int)aLong);
+            return jsNumber(aLong);
         }
             
         case float_type: {
             jfloatArray floatArray = (jfloatArray)javaArray();
             jfloat aFloat;
             env->GetFloatArrayRegion(floatArray, index, 1, &aFloat);
-            return Number (aFloat);
+            return jsNumber(aFloat);
         }
             
         case double_type: {
             jdoubleArray doubleArray = (jdoubleArray)javaArray();
             jdouble aDouble;
             env->GetDoubleArrayRegion(doubleArray, index, 1, &aDouble);
-            return Number (aDouble);
+            return jsNumber(aDouble);
         }
         default:
         break;
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 unsigned int JavaArray::getLength() const
index 4e5fcb4..b65dcff 100644 (file)
@@ -210,7 +210,7 @@ static List listFromNSArray(ExecState *exec, NSArray *array)
 
     if (exec->hadException()) {
         LOG_EXCEPTION (exec);
-        result = Undefined();
+        result = jsUndefined();
     }
 
     // Convert and return the result of the function call.
@@ -241,13 +241,13 @@ static List listFromNSArray(ExecState *exec, NSArray *array)
     if (type == Normal) {
         result = completion.value();
         if (!result)
-            result = Undefined();
+            result = jsUndefined();
     } else
-        result = Undefined();
+        result = jsUndefined();
     
     if (exec->hadException()) {
         LOG_EXCEPTION (exec);
-        result = Undefined();
+        result = jsUndefined();
     }
     
     id resultObj = [WebScriptObject _convertValueToObjcValue:result originExecutionContext:[self _originExecutionContext] executionContext:[self _executionContext]];
@@ -294,7 +294,7 @@ static List listFromNSArray(ExecState *exec, NSArray *array)
     
     if (exec->hadException()) {
         LOG_EXCEPTION (exec);
-        result = Undefined();
+        result = jsUndefined();
     }
 
     id resultObj = [WebScriptObject _convertValueToObjcValue:result originExecutionContext:[self _originExecutionContext] executionContext:[self _executionContext]];
@@ -358,7 +358,7 @@ static List listFromNSArray(ExecState *exec, NSArray *array)
 
     if (exec->hadException()) {
         LOG_EXCEPTION (exec);
-        result = Undefined();
+        result = jsUndefined();
     }
 
     id resultObj = [WebScriptObject _convertValueToObjcValue:result originExecutionContext:[self _originExecutionContext] executionContext:[self _executionContext]];
index 1fc44f0..5176ba6 100644 (file)
@@ -143,7 +143,7 @@ NS_DURING
     if (method->isFallbackMethod()) {
         if (objcValueTypeForType([signature methodReturnType]) != ObjcObjectType) {
             NSLog(@"Incorrect signature for invokeUndefinedMethodFromWebScript:withArguments: -- return type must be object.");
-            NS_VALUERETURN(Undefined(), ValueImp *);
+            NS_VALUERETURN(jsUndefined(), ValueImp *);
         }
         
         // Invoke invokeUndefinedMethodFromWebScript:withArguments:, pass JavaScript function
@@ -223,7 +223,7 @@ NS_DURING
     assert ([signature methodReturnLength] < 1024);
     
     if (*type == 'v') {
-        resultValue = Undefined();
+        resultValue = jsUndefined();
     }
     else {
         [invocation getReturnValue:buffer];
@@ -232,7 +232,7 @@ NS_DURING
 
 NS_HANDLER
     
-    resultValue = Undefined();
+    resultValue = jsUndefined();
 
 NS_ENDHANDLER
 
@@ -246,7 +246,7 @@ ValueImp *ObjcInstance::invokeDefaultMethod (ExecState *exec, const List &args)
 NS_DURING
 
     if (![_instance respondsToSelector:@selector(invokeDefaultMethodWithArguments:)])
-        NS_VALUERETURN(Undefined(), ValueImp *);
+        NS_VALUERETURN(jsUndefined(), ValueImp *);
     
     NSMethodSignature *signature = [_instance methodSignatureForSelector:@selector(invokeDefaultMethodWithArguments:)];
     NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
@@ -256,7 +256,7 @@ NS_DURING
     
     if (objcValueTypeForType([signature methodReturnType]) != ObjcObjectType) {
         NSLog(@"Incorrect signature for invokeDefaultMethodWithArguments: -- return type must be object.");
-        NS_VALUERETURN(Undefined(), ValueImp *);
+        NS_VALUERETURN(jsUndefined(), ValueImp *);
     }
     
     NSMutableArray *objcArgs = [NSMutableArray array];
@@ -283,7 +283,7 @@ NS_DURING
 
 NS_HANDLER
 
-    resultValue = Undefined();
+    resultValue = jsUndefined();
 
 NS_ENDHANDLER
 
@@ -334,7 +334,7 @@ ValueImp *ObjcInstance::getValueOfField (ExecState *exec, const Field *aField) c
 
 ValueImp *ObjcInstance::getValueOfUndefinedField (ExecState *exec, const Identifier &property, Type hint) const
 {
-    ValueImp *volatile result = Undefined();
+    ValueImp *volatile result = jsUndefined();
     
     id targetObject = getObject();
     
index 29e1028..ee5c81e 100644 (file)
@@ -123,7 +123,7 @@ ValueImp *ObjcField::valueFromInstance(ExecState *exec, const Instance *instance
     if (objcValue)
         aValue = convertObjcValueToValue (exec, &objcValue, ObjcObjectType);
     else
-        aValue = Undefined();
+        aValue = jsUndefined();
 
     return aValue;
 }
@@ -299,7 +299,7 @@ bool ObjcFallbackObjectImp::implementsCall() const
 
 ValueImp *ObjcFallbackObjectImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
-    ValueImp *result = Undefined();
+    ValueImp *result = jsUndefined();
     
     RuntimeObjectImp *imp = static_cast<RuntimeObjectImp*>(thisObj);
     if (imp) {
index d31b068..db93a25 100644 (file)
@@ -173,7 +173,7 @@ ValueImp *convertNSStringToString(NSString *nsstring)
     chars = (unichar *)malloc(sizeof(unichar)*length);
     [nsstring getCharacters:chars];
     UString u((const UChar*)chars, length);
-    ValueImp *aValue = String (u);
+    ValueImp *aValue = jsString(u);
     free((void *)chars);
     return aValue;
 }
@@ -210,78 +210,51 @@ ValueImp *convertObjcValueToValue (ExecState *exec, void *buffer, ObjcValueType
                     id       to Object wrapper
                 */
                 if ([*obj isKindOfClass:[NSString class]]){
-                    NSString *string = (NSString *)*obj;
-                    aValue = convertNSStringToString (string);
-                }
-                else if (*obj == [WebUndefined undefined]) {
-                    return Undefined();
-                }
-                else if ((CFBooleanRef)*obj == kCFBooleanTrue) {
-                    aValue = Boolean(true);
-                }
-                else if ((CFBooleanRef)*obj == kCFBooleanFalse) {
-                    aValue = Boolean(false);
-                }
-                else if ([*obj isKindOfClass:[NSNumber class]]) {
-                    aValue = Number([*obj doubleValue]);
-                }
-                else if ([*obj isKindOfClass:[NSArray class]]) {
-                    aValue = new RuntimeArrayImp(exec, new ObjcArray (*obj));
-                }
-                else if ([*obj isKindOfClass:[WebScriptObject class]]) {
+                    aValue = convertNSStringToString((NSString *)*obj);
+                } else if (*obj == [WebUndefined undefined]) {
+                    return jsUndefined();
+                }  else if ((CFBooleanRef)*obj == kCFBooleanTrue) {
+                    aValue = jsBoolean(true);
+                } else if ((CFBooleanRef)*obj == kCFBooleanFalse) {
+                    aValue = jsBoolean(false);
+                } else if ([*obj isKindOfClass:[NSNumber class]]) {
+                    aValue = jsNumber([*obj doubleValue]);
+                } else if ([*obj isKindOfClass:[NSArray class]]) {
+                    aValue = new RuntimeArrayImp(exec, new ObjcArray(*obj));
+                } else if ([*obj isKindOfClass:[WebScriptObject class]]) {
                     WebScriptObject *jsobject = (WebScriptObject *)*obj;
                     aValue = [jsobject _imp];
-                }
-                else if (*obj == 0) {
-                    return Undefined();
-                }
-                else {
+                } else if (*obj == 0) {
+                    return jsUndefined();
+                } else {
                    aValue = Instance::createRuntimeObject(Instance::ObjectiveCLanguage, (void *)*obj);
                 }
             }
             break;
         case ObjcCharType:
-            {
-                char *objcVal = (char *)buffer;
-                aValue = Number ((short)*objcVal);
-            }
+            aValue = jsNumber(*(char *)buffer);
             break;
         case ObjcShortType:
-            {
-                short *objcVal = (short *)buffer;
-                aValue = Number ((short)*objcVal);
-            }
+            aValue = jsNumber(*(short *)buffer);
             break;
         case ObjcIntType:
-            {
-                int *objcVal = (int *)buffer;
-                aValue = Number ((int)*objcVal);
-            }
+            aValue = jsNumber(*(int *)buffer);
             break;
         case ObjcLongType:
-            {
-                long *objcVal = (long *)buffer;
-                aValue = Number ((long)*objcVal);
-            }
+            aValue = jsNumber(*(long *)buffer);
             break;
         case ObjcFloatType:
-            {
-                float *objcVal = (float *)buffer;
-                aValue = Number ((float)*objcVal);
-            }
+            aValue = jsNumber(*(float *)buffer);
             break;
         case ObjcDoubleType:
-            {
-                double *objcVal = (double *)buffer;
-                aValue = Number ((double)*objcVal);
-            }
+            aValue = jsNumber(*(double *)buffer);
             break;
         default:
             // Should never get here.  Argument types are filtered (and
             // the assert above should have fired in the impossible case
             // of an invalid type anyway).
-            fprintf (stderr, "%s:  invalid type (%d)\n", __PRETTY_FUNCTION__, (int)type);
-            assert (true);
+            fprintf(stderr, "%s: invalid type (%d)\n", __PRETTY_FUNCTION__, (int)type);
+            assert(false);
     }
     
     return aValue;
index cf7bc84..07e3d31 100644 (file)
@@ -114,7 +114,7 @@ public:
     
     virtual Field *fieldNamed(const char *name, Instance *instance) const = 0;
 
-    virtual ValueImp *fallbackObject(ExecState *, Instance *, const Identifier &) { return Undefined(); }
+    virtual ValueImp *fallbackObject(ExecState *, Instance *, const Identifier &) { return jsUndefined(); }
     
     virtual ~Class() {}
 };
@@ -152,7 +152,7 @@ public:
     virtual Class *getClass() const = 0;
     
     virtual ValueImp *getValueOfField(ExecState *exec, const Field *aField) const;
-    virtual ValueImp *getValueOfUndefinedField(ExecState *exec, const Identifier &property, Type hint) const { return Undefined(); }
+    virtual ValueImp *getValueOfUndefinedField(ExecState *exec, const Identifier &property, Type hint) const { return jsUndefined(); }
     virtual void setValueOfField(ExecState *exec, const Field *aField, ValueImp *aValue) const;
     virtual bool supportsSetValueOfUndefinedField() { return false; }
     virtual void setValueOfUndefinedField(ExecState *exec, const Identifier &property, ValueImp *aValue) {}
@@ -162,7 +162,7 @@ public:
     
     virtual ValueImp *defaultValue(Type hint) const = 0;
     
-    virtual ValueImp *valueOf() const { return String(getClass()->name()); }
+    virtual ValueImp *valueOf() const { return jsString(getClass()->name()); }
     
     void setExecutionContext(const RootObject *r) { _executionContext = r; }
     const RootObject *executionContext() const { return _executionContext; }
index e878a3c..2e35523 100644 (file)
@@ -47,7 +47,7 @@ RuntimeArrayImp::~RuntimeArrayImp()
 ValueImp *RuntimeArrayImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
     RuntimeArrayImp *thisObj = static_cast<RuntimeArrayImp *>(slot.slotBase());
-    return Number(thisObj->getLength());
+    return jsNumber(thisObj->getLength());
 }
 
 ValueImp *RuntimeArrayImp::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
index 46dbcb3..a5560bc 100644 (file)
@@ -51,7 +51,7 @@ ValueImp *RuntimeMethodImp::lengthGetter(ExecState *exec, const Identifier& prop
     // Java does.
     // FIXME: a better solution might be to give the maximum number of parameters
     // of any method
-    return Number(thisObj->_methodList.methodAt(0)->numParameters());
+    return jsNumber(thisObj->_methodList.methodAt(0)->numParameters());
 }
 
 bool RuntimeMethodImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot &slot)
@@ -96,7 +96,7 @@ ValueImp *RuntimeMethodImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
         }
     }
     
-    return Undefined();
+    return jsUndefined();
 }
 
 CodeType RuntimeMethodImp::codeType() const
@@ -107,6 +107,6 @@ CodeType RuntimeMethodImp::codeType() const
 
 Completion RuntimeMethodImp::execute(ExecState *exec)
 {
-    return Completion(Normal, Undefined());
+    return Completion(Normal, jsUndefined());
 }
 
index 834a419..17ac77d 100644 (file)
@@ -76,7 +76,7 @@ ArrayInstanceImp::~ArrayInstanceImp()
 
 ValueImp *ArrayInstanceImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
-  return Number(static_cast<ArrayInstanceImp *>(slot.slotBase())->length);
+  return jsNumber(static_cast<ArrayInstanceImp *>(slot.slotBase())->length);
 }
 
 bool ArrayInstanceImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -291,8 +291,8 @@ struct CompareWithCompareFunctionArguments {
         , compareFunction(cf)
         , globalObject(e->dynamicInterpreter()->globalObject())
     {
-        arguments.append(Undefined());
-        arguments.append(Undefined());
+        arguments.append(jsUndefined());
+        arguments.append(jsUndefined());
     }
 
     ExecState *exec;
@@ -400,7 +400,7 @@ ArrayPrototypeImp::ArrayPrototypeImp(ExecState *exec,
                                      ObjectPrototypeImp *objProto)
   : ArrayInstanceImp(objProto, 0)
 {
-  setInternalValue(Null());
+  setInternalValue(jsNull());
 }
 
 bool ArrayPrototypeImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -415,7 +415,7 @@ ArrayProtoFuncImp::ArrayProtoFuncImp(ExecState *exec, int i, int len)
     static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
     ), id(i)
 {
-  put(exec,lengthPropertyName,Number(len),DontDelete|ReadOnly|DontEnum);
+  put(exec,lengthPropertyName,jsNumber(len),DontDelete|ReadOnly|DontEnum);
 }
 
 bool ArrayProtoFuncImp::implementsCall() const
@@ -494,7 +494,7 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
         break;
     }
     visitedElems.remove(thisObj);
-    result = String(str);
+    result = jsString(str);
     break;
   }
   case Concat: {
@@ -525,18 +525,18 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
       curArg = *it;
       curObj = static_cast<ObjectImp *>(it++); // may be 0
     }
-    arr->put(exec,lengthPropertyName, Number(n), DontEnum | DontDelete);
+    arr->put(exec,lengthPropertyName, jsNumber(n), DontEnum | DontDelete);
 
     result = arr;
     break;
   }
   case Pop:{
     if (length == 0) {
-      thisObj->put(exec, lengthPropertyName, Number(length), DontEnum | DontDelete);
-      result = Undefined();
+      thisObj->put(exec, lengthPropertyName, jsNumber(length), DontEnum | DontDelete);
+      result = jsUndefined();
     } else {
       result = thisObj->get(exec, length - 1);
-      thisObj->put(exec, lengthPropertyName, Number(length - 1), DontEnum | DontDelete);
+      thisObj->put(exec, lengthPropertyName, jsNumber(length - 1), DontEnum | DontDelete);
     }
     break;
   }
@@ -544,8 +544,8 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
     for (int n = 0; n < args.size(); n++)
       thisObj->put(exec, length + n, args[n]);
     length += args.size();
-    thisObj->put(exec,lengthPropertyName, Number(length), DontEnum | DontDelete);
-    result = Number(length);
+    thisObj->put(exec,lengthPropertyName, jsNumber(length), DontEnum | DontDelete);
+    result = jsNumber(length);
     break;
   }
   case Reverse: {
@@ -572,8 +572,8 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
   }
   case Shift: {
     if (length == 0) {
-      thisObj->put(exec, lengthPropertyName, Number(length), DontEnum | DontDelete);
-      result = Undefined();
+      thisObj->put(exec, lengthPropertyName, jsNumber(length), DontEnum | DontDelete);
+      result = jsUndefined();
     } else {
       result = thisObj->get(exec, 0);
       for(unsigned int k = 1; k < length; k++) {
@@ -583,7 +583,7 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
           thisObj->deleteProperty(exec, k-1);
       }
       thisObj->deleteProperty(exec, length - 1);
-      thisObj->put(exec, lengthPropertyName, Number(length - 1), DontEnum | DontDelete);
+      thisObj->put(exec, lengthPropertyName, jsNumber(length - 1), DontEnum | DontDelete);
     }
     break;
   }
@@ -626,7 +626,7 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
       if (ValueImp *v = getProperty(exec, thisObj, k))
         resObj->put(exec, n, v);
     }
-    resObj->put(exec, lengthPropertyName, Number(n), DontEnum | DontDelete);
+    resObj->put(exec, lengthPropertyName, jsNumber(n), DontEnum | DontDelete);
     break;
   }
   case Sort:{
@@ -653,7 +653,7 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
     }
 
     if (length == 0) {
-      thisObj->put(exec, lengthPropertyName, Number(0), DontEnum | DontDelete);
+      thisObj->put(exec, lengthPropertyName, jsNumber(0), DontEnum | DontDelete);
       result = thisObj;
       break;
     }
@@ -719,7 +719,7 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
       if (ValueImp *v = getProperty(exec, thisObj, k+begin))
         resObj->put(exec, k, v);
     }
-    resObj->put(exec, lengthPropertyName, Number(deleteCount), DontEnum | DontDelete);
+    resObj->put(exec, lengthPropertyName, jsNumber(deleteCount), DontEnum | DontDelete);
 
     unsigned int additionalArgs = maxInt( args.size() - 2, 0 );
     if ( additionalArgs != deleteCount )
@@ -751,7 +751,7 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
     {
       thisObj->put(exec, k+begin, args[k+2]);
     }
-    thisObj->put(exec, lengthPropertyName, Number(length - deleteCount + additionalArgs), DontEnum | DontDelete);
+    thisObj->put(exec, lengthPropertyName, jsNumber(length - deleteCount + additionalArgs), DontEnum | DontDelete);
     break;
   }
   case UnShift: { // 15.4.4.13
@@ -765,7 +765,7 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
     }
     for ( unsigned int k = 0; k < nrArgs; ++k )
       thisObj->put(exec, k, args[k]);
-    result = Number(length + nrArgs);
+    result = jsNumber(length + nrArgs);
     thisObj->put(exec, lengthPropertyName, result, DontEnum | DontDelete);
     break;
   }
@@ -785,7 +785,7 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
     ObjectImp *applyThis = args[1]->isUndefinedOrNull() ? exec->dynamicInterpreter()->globalObject() :  args[1]->toObject(exec);
     
     if (id == Some || id == Every)
-      result = Boolean(id == Every);
+      result = jsBoolean(id == Every);
     else
       result = thisObj;
     
@@ -794,17 +794,17 @@ ValueImp *ArrayProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
       List eachArguments;
       
       eachArguments.append(thisObj->get(exec, k));
-      eachArguments.append(Number(k));
+      eachArguments.append(jsNumber(k));
       eachArguments.append(thisObj);
       
       bool predicateResult = eachFunction->call(exec, applyThis, eachArguments)->toBoolean(exec);
       
       if (id == Every && !predicateResult) {
-        result = Boolean(false);
+        result = jsBoolean(false);
         break;
       }
       if (id == Some && predicateResult) {
-        result = Boolean(true);
+        result = jsBoolean(true);
         break;
       }
     }
@@ -827,10 +827,10 @@ ArrayObjectImp::ArrayObjectImp(ExecState *exec,
   : InternalFunctionImp(funcProto)
 {
   // ECMA 15.4.3.1 Array.prototype
-  put(exec,prototypePropertyName, arrayProto, DontEnum|DontDelete|ReadOnly);
+  put(exec, prototypePropertyName, arrayProto, DontEnum|DontDelete|ReadOnly);
 
   // no. of arguments for constructor
-  put(exec,lengthPropertyName, Number(1), ReadOnly|DontDelete|DontEnum);
+  put(exec, lengthPropertyName, jsNumber(1), ReadOnly|DontDelete|DontEnum);
 }
 
 bool ArrayObjectImp::implementsConstruct() const
index 8e29b0e..57e8589 100644 (file)
@@ -55,7 +55,7 @@ BooleanPrototypeImp::BooleanPrototypeImp(ExecState *exec,
 
   putDirect(toStringPropertyName, new BooleanProtoFuncImp(exec,funcProto,BooleanProtoFuncImp::ToString,0), DontEnum);
   putDirect(valueOfPropertyName,  new BooleanProtoFuncImp(exec,funcProto,BooleanProtoFuncImp::ValueOf,0),  DontEnum);
-  setInternalValue(Boolean(false));
+  setInternalValue(jsBoolean(false));
 }
 
 
@@ -88,8 +88,8 @@ ValueImp *BooleanProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisOb
   assert(v);
 
   if (id == ToString)
-    return String(v->toString(exec));
-  return Boolean(v->toBoolean(exec)); /* TODO: optimize for bool case */
+    return jsString(v->toString(exec));
+  return jsBoolean(v->toBoolean(exec)); /* TODO: optimize for bool case */
 }
 
 // ------------------------------ BooleanObjectImp -----------------------------
@@ -102,7 +102,7 @@ BooleanObjectImp::BooleanObjectImp(ExecState *exec, FunctionPrototypeImp *funcPr
   putDirect(prototypePropertyName, booleanProto, DontEnum|DontDelete|ReadOnly);
 
   // no. of arguments for constructor
-  putDirect(lengthPropertyName, jsOne(), ReadOnly|DontDelete|DontEnum);
+  putDirect(lengthPropertyName, jsNumber(1), ReadOnly|DontDelete|DontEnum);
 }
 
 
@@ -136,8 +136,8 @@ bool BooleanObjectImp::implementsCall() const
 ValueImp *BooleanObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
 {
   if (args.isEmpty())
-    return Boolean(false);
+    return jsBoolean(false);
   else
-    return Boolean(args[0]->toBoolean(exec)); /* TODO: optimize for bool case */
+    return jsBoolean(args[0]->toBoolean(exec)); /* TODO: optimize for bool case */
 }
 
index 96fc895..497ec44 100644 (file)
@@ -48,11 +48,11 @@ ErrorPrototypeImp::ErrorPrototypeImp(ExecState *exec,
                                      FunctionPrototypeImp *funcProto)
   : ObjectImp(objectProto)
 {
-  setInternalValue(Undefined());
+  setInternalValue(jsUndefined());
   // The constructor will be added later in ErrorObjectImp's constructor
 
-  put(exec, namePropertyName,     String("Error"), DontEnum);
-  put(exec, messagePropertyName,  String("Unknown error"), DontEnum);
+  put(exec, namePropertyName,     jsString("Error"), DontEnum);
+  put(exec, messagePropertyName,  jsString("Unknown error"), DontEnum);
   putDirect(toStringPropertyName, new ErrorProtoFuncImp(exec,funcProto), DontEnum);
 }
 
@@ -61,7 +61,7 @@ ErrorPrototypeImp::ErrorPrototypeImp(ExecState *exec,
 ErrorProtoFuncImp::ErrorProtoFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto)
   : InternalFunctionImp(funcProto)
 {
-  putDirect(lengthPropertyName, jsZero(), DontDelete|ReadOnly|DontEnum);
+  putDirect(lengthPropertyName, jsNumber(0), DontDelete|ReadOnly|DontEnum);
 }
 
 bool ErrorProtoFuncImp::implementsCall() const
@@ -84,7 +84,7 @@ ValueImp *ErrorProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj,
     s += ": " + v->toString(exec); // Mozilla compatible format
   }
 
-  return String(s);
+  return jsString(s);
 }
 
 // ------------------------------ ErrorObjectImp -------------------------------
@@ -95,8 +95,8 @@ ErrorObjectImp::ErrorObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto,
 {
   // ECMA 15.11.3.1 Error.prototype
   putDirect(prototypePropertyName, errorProto, DontEnum|DontDelete|ReadOnly);
-  putDirect(lengthPropertyName, jsOne(), DontDelete|ReadOnly|DontEnum);
-  //putDirect(namePropertyName, String(n));
+  putDirect(lengthPropertyName, jsNumber(1), DontDelete|ReadOnly|DontEnum);
+  //putDirect(namePropertyName, jsString(n));
 }
 
 bool ErrorObjectImp::implementsConstruct() const
@@ -148,7 +148,7 @@ NativeErrorImp::NativeErrorImp(ExecState *exec, FunctionPrototypeImp *funcProto,
                                ObjectImp *prot)
   : InternalFunctionImp(funcProto), proto(prot)
 {
-  putDirect(lengthPropertyName, jsOne(), DontDelete|ReadOnly|DontEnum); // ECMA 15.11.7.5
+  putDirect(lengthPropertyName, jsNumber(1), DontDelete|ReadOnly|DontEnum); // ECMA 15.11.7.5
   putDirect(prototypePropertyName, proto, DontDelete|ReadOnly|DontEnum);
 }
 
index 9c4d008..99da4e1 100644 (file)
@@ -100,7 +100,7 @@ ValueImp *FunctionImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const
     bool cont = dbg->callEvent(&newExec,sid,lineno,this,args);
     if (!cont) {
       dbg->imp()->abort();
-      return Undefined();
+      return jsUndefined();
     }
   }
 
@@ -129,7 +129,7 @@ ValueImp *FunctionImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const
     int cont = dbg->returnEvent(&newExec,sid,lineno,this);
     if (!cont) {
       dbg->imp()->abort();
-      return Undefined();
+      return jsUndefined();
     }
   }
 
@@ -140,7 +140,7 @@ ValueImp *FunctionImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const
   else if (comp.complType() == ReturnValue)
     return comp.value();
   else
-    return Undefined();
+    return jsUndefined();
 }
 
 void FunctionImp::addParameter(const Identifier &n)
@@ -190,7 +190,7 @@ void FunctionImp::processParameters(ExecState *exec, const List &args)
        variable->put(exec, p->name, *it);
        it++;
       } else
-       variable->put(exec, p->name, Undefined());
+       variable->put(exec, p->name, jsUndefined());
       p = p->next;
     }
   }
@@ -216,7 +216,7 @@ ValueImp *FunctionImp::argumentsGetter(ExecState *exec, const Identifier& proper
     }
     context = context->callingContext();
   }
-  return Null();
+  return jsNull();
 }
 
 ValueImp *FunctionImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -228,7 +228,7 @@ ValueImp *FunctionImp::lengthGetter(ExecState *exec, const Identifier& propertyN
     ++count;
     p = p->next;
   }
-  return Number(count);
+  return jsNumber(count);
 }
 
 bool FunctionImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -337,7 +337,7 @@ Completion DeclaredFunctionImp::execute(ExecState *exec)
 
   if (result.complType() == Throw || result.complType() == ReturnValue)
       return result;
-  return Completion(Normal, Undefined()); // TODO: or ReturnValue ?
+  return Completion(Normal, jsUndefined()); // TODO: or ReturnValue ?
 }
 
 void DeclaredFunctionImp::processVarDecls(ExecState *exec)
@@ -575,7 +575,7 @@ static ValueImp *encode(ExecState *exec, const List &args, const char *do_not_es
       r += tmp;
     }
   }
-  return String(r);
+  return jsString(r);
 }
 
 static ValueImp *decode(ExecState *exec, const List &args, const char *do_not_unescape, bool strict)
@@ -640,7 +640,7 @@ static ValueImp *decode(ExecState *exec, const List &args, const char *do_not_un
     k++;
     s.append(c);
   }
-  return String(s);
+  return jsString(s);
 }
 
 static bool isStrWhiteSpace(unsigned short c)
@@ -787,7 +787,7 @@ ValueImp *GlobalFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/,
         if (dbg) {
           bool cont = dbg->sourceParsed(exec, sid, UString(), s, errLine);
           if (!cont)
-            return Undefined();
+            return jsUndefined();
         }
 
         // no program node means a syntax occurred
@@ -814,7 +814,7 @@ ValueImp *GlobalFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/,
         if (newExec.hadException())
           exec->setException(newExec.exception());
 
-        res = Undefined();
+        res = jsUndefined();
         if (c.complType() == Throw)
           exec->setException(c.value());
         else if (c.isValueCompletion())
@@ -823,17 +823,17 @@ ValueImp *GlobalFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/,
       break;
     }
   case ParseInt:
-    res = Number(parseInt(args[0]->toString(exec), args[1]->toInt32(exec)));
+    res = jsNumber(parseInt(args[0]->toString(exec), args[1]->toInt32(exec)));
     break;
   case ParseFloat:
-    res = Number(parseFloat(args[0]->toString(exec)));
+    res = jsNumber(parseFloat(args[0]->toString(exec)));
     break;
   case IsNaN:
-    res = Boolean(isNaN(args[0]->toNumber(exec)));
+    res = jsBoolean(isNaN(args[0]->toNumber(exec)));
     break;
   case IsFinite: {
     double n = args[0]->toNumber(exec);
-    res = Boolean(!isNaN(n) && !isInf(n));
+    res = jsBoolean(!isNaN(n) && !isInf(n));
     break;
   }
   case DecodeURI:
@@ -867,7 +867,7 @@ ValueImp *GlobalFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/,
         }
         r += s;
       }
-      res = String(r);
+      res = jsString(r);
       break;
     }
   case UnEscape:
@@ -894,7 +894,7 @@ ValueImp *GlobalFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/,
         k++;
         s += UString(c, 1);
       }
-      res = String(s);
+      res = jsString(s);
       break;
     }
 #ifndef NDEBUG
index a56b77a..330434c 100644 (file)
@@ -40,7 +40,7 @@ using namespace KJS;
 
 FunctionPrototypeImp::FunctionPrototypeImp(ExecState *exec)
 {
-  putDirect(lengthPropertyName,   jsZero(),                                                       DontDelete|ReadOnly|DontEnum);
+  putDirect(lengthPropertyName,   jsNumber(0),                                                       DontDelete|ReadOnly|DontEnum);
   putDirect(toStringPropertyName, new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::ToString, 0), DontEnum);
   static const Identifier applyPropertyName("apply");
   putDirect(applyPropertyName,    new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::Apply,    2), DontEnum);
@@ -60,7 +60,7 @@ bool FunctionPrototypeImp::implementsCall() const
 // ECMA 15.3.4
 ValueImp *FunctionPrototypeImp::callAsFunction(ExecState */*exec*/, ObjectImp */*thisObj*/, const List &/*args*/)
 {
-  return Undefined();
+  return jsUndefined();
 }
 
 // ------------------------------ FunctionProtoFuncImp -------------------------
@@ -94,14 +94,14 @@ ValueImp *FunctionProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisO
     if (thisObj->inherits(&DeclaredFunctionImp::info)) {
        DeclaredFunctionImp *fi = static_cast<DeclaredFunctionImp*>
                                  (thisObj);
-       return String("function " + fi->name().ustring() + "(" +
+       return jsString("function " + fi->name().ustring() + "(" +
          fi->parameterString() + ") " + fi->body->toString());
     } else if (thisObj->inherits(&FunctionImp::info) &&
         !static_cast<FunctionImp*>(thisObj)->name().isNull()) {
-      result = String("function " + static_cast<FunctionImp*>(thisObj)->name().ustring() + "()");
+      result = jsString("function " + static_cast<FunctionImp*>(thisObj)->name().ustring() + "()");
     }
     else {
-      result = String("(Internal Function)");
+      result = jsString("(Internal Function)");
     }
     }
     break;
@@ -165,7 +165,7 @@ FunctionObjectImp::FunctionObjectImp(ExecState *exec, FunctionPrototypeImp *func
   putDirect(prototypePropertyName, funcProto, DontEnum|DontDelete|ReadOnly);
 
   // no. of arguments for constructor
-  putDirect(lengthPropertyName, jsOne(), ReadOnly|DontDelete|DontEnum);
+  putDirect(lengthPropertyName, jsNumber(1), ReadOnly|DontDelete|DontEnum);
 }
 
 FunctionObjectImp::~FunctionObjectImp()
index 52dd07e..4e817a4 100644 (file)
@@ -529,8 +529,8 @@ InterpreterImp::InterpreterImp(Interpreter *interp, ObjectImp *glob)
 
   // built-in values
   global->put(&globExec, "NaN",        jsNaN(), DontEnum|DontDelete);
-  global->put(&globExec, "Infinity",   Number(Inf), DontEnum|DontDelete);
-  global->put(&globExec, "undefined",  Undefined(), DontEnum|DontDelete);
+  global->put(&globExec, "Infinity",   jsNumber(Inf), DontEnum|DontDelete);
+  global->put(&globExec, "undefined",  jsUndefined(), DontEnum|DontDelete);
 
   // built-in functions
   global->put(&globExec, "eval",       new GlobalFuncImp(&globExec, funcProto, GlobalFuncImp::Eval, 1), DontEnum);
index 965cd24..81e0b27 100644 (file)
@@ -200,7 +200,7 @@ namespace KJS {
      *
      * @param code The code to evaluate
      * @param thisV The value to pass in as the "this" value for the script
-     * execution. This should either be Null() or an Object.
+     * execution. This should either be jsNull() or an Object.
      * @return A completion object representing the result of the execution.
      */
     Completion evaluate(const UString &sourceURL, int startingLineNumber, const UString &code, ValueImp *thisV = NULL);
index deb39f0..accfd48 100644 (file)
@@ -329,7 +329,7 @@ namespace KJS {
   public: \
     ClassFunc(ExecState *exec, int i, int len) : id(i) \
     { \
-       put(exec, lengthPropertyName, Number(len), DontDelete|ReadOnly|DontEnum); \
+       put(exec, lengthPropertyName, jsNumber(len), DontDelete|ReadOnly|DontEnum); \
     } \
     /* Macro user needs to implement the callAsFunction function. */ \
     virtual ValueImp *callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args); \
index b286405..5c14482 100644 (file)
@@ -145,7 +145,7 @@ ValueImp *MathObjectImp::getValueProperty(ExecState *, int token) const
     assert(0);
   }
 
-  return Number(d);
+  return jsNumber(d);
 }
 
 // ------------------------------ MathObjectImp --------------------------------
@@ -282,5 +282,5 @@ ValueImp *MathFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, c
     assert(0);
   }
 
-  return Number(result);
+  return jsNumber(result);
 }
index 12a0383..e7c3b2b 100644 (file)
@@ -70,10 +70,10 @@ using namespace KJS;
 #define KJS_CHECKEXCEPTIONVALUE \
   if (exec->hadException()) { \
     setExceptionDetailsIfNeeded(exec); \
-    return Undefined(); \
+    return jsUndefined(); \
   } \
   if (Collector::outOfMemory()) \
-    return Undefined(); // will be picked up by KJS_CHECKEXCEPTION
+    return jsUndefined(); // will be picked up by KJS_CHECKEXCEPTION
 
 #define KJS_CHECKEXCEPTIONLIST \
   if (exec->hadException()) { \
@@ -174,8 +174,8 @@ void Node::setExceptionDetailsIfNeeded(ExecState *exec)
     if (exceptionValue->isObject()) {
         ObjectImp *exception = static_cast<ObjectImp *>(exceptionValue);
         if (!exception->hasProperty(exec, "line") && !exception->hasProperty(exec, "sourceURL")) {
-            exception->put(exec, "line", Number(line));
-            exception->put(exec, "sourceURL", String(sourceURL));
+            exception->put(exec, "line", jsNumber(line));
+            exception->put(exec, "sourceURL", jsString(sourceURL));
         }
     }
 }
@@ -216,7 +216,7 @@ void StatementNode::processFuncDecl(ExecState *exec)
 
 ValueImp *NullNode::evaluate(ExecState *)
 {
-  return Null();
+  return jsNull();
 }
 
 // ------------------------------ BooleanNode ----------------------------------
@@ -380,9 +380,9 @@ ValueImp *PropertyNode::evaluate(ExecState *)
   ValueImp *s;
 
   if (str.isNull()) {
-    s = String(UString::from(numeric));
+    s = jsString(UString::from(numeric));
   } else {
-    s = String(str.ustring());
+    s = jsString(str.ustring());
   }
 
   return s;
@@ -571,13 +571,13 @@ ValueImp *FunctionCallBracketNode::evaluate(ExecState *exec)
     if (baseObj->getPropertySlot(exec, i, slot))
       funcVal = slot.getValue(exec, i);
     else
-      funcVal = Undefined();
+      funcVal = jsUndefined();
   } else {
     Identifier ident(subscriptVal->toString(exec));
     if (baseObj->getPropertySlot(exec, ident, slot))
       funcVal = baseObj->get(exec, ident);
     else
-      funcVal = Undefined();
+      funcVal = jsUndefined();
   }
 
   KJS_CHECKEXCEPTIONVALUE
@@ -620,7 +620,7 @@ ValueImp *FunctionCallDotNode::evaluate(ExecState *exec)
 
   ObjectImp *baseObj = baseVal->toObject(exec);
   PropertySlot slot;
-  ValueImp *funcVal = baseObj->getPropertySlot(exec, ident, slot) ? slot.getValue(exec, ident) : Undefined();
+  ValueImp *funcVal = baseObj->getPropertySlot(exec, ident, slot) ? slot.getValue(exec, ident) : jsUndefined();
   KJS_CHECKEXCEPTIONVALUE
 
   if (!funcVal->isObject())
@@ -690,7 +690,7 @@ ValueImp *PostfixBracketNode::evaluate(ExecState *exec)
   uint32_t propertyIndex;
   if (subscript->getUInt32(propertyIndex)) {
     PropertySlot slot;
-    ValueImp *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : Undefined();
+    ValueImp *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();
     KJS_CHECKEXCEPTIONVALUE
 
     double n = v->toNumber(exec);
@@ -703,7 +703,7 @@ ValueImp *PostfixBracketNode::evaluate(ExecState *exec)
 
   Identifier propertyName(subscript->toString(exec));
   PropertySlot slot;
-  ValueImp *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : Undefined();
+  ValueImp *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();
   KJS_CHECKEXCEPTIONVALUE
 
   double n = v->toNumber(exec);
@@ -723,7 +723,7 @@ ValueImp *PostfixDotNode::evaluate(ExecState *exec)
   ObjectImp *base = baseValue->toObject(exec);
 
   PropertySlot slot;
-  ValueImp *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : Undefined();
+  ValueImp *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();
   KJS_CHECKEXCEPTIONVALUE
 
   double n = v->toNumber(exec);
@@ -806,7 +806,7 @@ ValueImp *VoidNode::evaluate(ExecState *exec)
   expr->evaluate(exec);
   KJS_CHECKEXCEPTIONVALUE
 
-  return Undefined();
+  return jsUndefined();
 }
 
 // ECMA 11.4.3
@@ -917,7 +917,7 @@ ValueImp *PrefixBracketNode::evaluate(ExecState *exec)
   uint32_t propertyIndex;
   if (subscript->getUInt32(propertyIndex)) {
     PropertySlot slot;
-    ValueImp *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : Undefined();
+    ValueImp *v = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();
     KJS_CHECKEXCEPTIONVALUE
 
     double n = v->toNumber(exec);
@@ -931,7 +931,7 @@ ValueImp *PrefixBracketNode::evaluate(ExecState *exec)
 
   Identifier propertyName(subscript->toString(exec));
   PropertySlot slot;
-  ValueImp *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : Undefined();
+  ValueImp *v = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();
   KJS_CHECKEXCEPTIONVALUE
 
   double n = v->toNumber(exec);
@@ -952,7 +952,7 @@ ValueImp *PrefixDotNode::evaluate(ExecState *exec)
   ObjectImp *base = baseValue->toObject(exec);
 
   PropertySlot slot;
-  ValueImp *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : Undefined();
+  ValueImp *v = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();
   KJS_CHECKEXCEPTIONVALUE
 
   double n = v->toNumber(exec);
@@ -1056,7 +1056,7 @@ ValueImp *ShiftNode::evaluate(ExecState *exec)
     return jsNumber(v1->toUInt32(exec) >> i2);
   default:
     assert(!"ShiftNode: unhandled switch case");
-    return Undefined();
+    return jsUndefined();
   }
 }
 
@@ -1255,7 +1255,7 @@ static inline ValueImp *valueForReadModifyAssignment(ExecState * exec, ValueImp
     break;
   default:
     assert(0);
-    v = Undefined();
+    v = jsUndefined();
   }
   
   return v;
@@ -1317,7 +1317,7 @@ ValueImp *AssignDotNode::evaluate(ExecState *exec)
     v = m_right->evaluate(exec);
   } else {
     PropertySlot slot;
-    ValueImp *v1 = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : Undefined();
+    ValueImp *v1 = base->getPropertySlot(exec, m_ident, slot) ? slot.getValue(exec, m_ident) : jsUndefined();
     KJS_CHECKEXCEPTIONVALUE
     ValueImp *v2 = m_right->evaluate(exec);
     v = valueForReadModifyAssignment(exec, v1, v2, m_oper);
@@ -1347,7 +1347,7 @@ ValueImp *AssignBracketNode::evaluate(ExecState *exec)
       v = m_right->evaluate(exec);
     } else {
       PropertySlot slot;
-      ValueImp *v1 = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : Undefined();
+      ValueImp *v1 = base->getPropertySlot(exec, propertyIndex, slot) ? slot.getValue(exec, propertyIndex) : jsUndefined();
       KJS_CHECKEXCEPTIONVALUE
       ValueImp *v2 = m_right->evaluate(exec);
       v = valueForReadModifyAssignment(exec, v1, v2, m_oper);
@@ -1366,7 +1366,7 @@ ValueImp *AssignBracketNode::evaluate(ExecState *exec)
     v = m_right->evaluate(exec);
   } else {
     PropertySlot slot;
-    ValueImp *v1 = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : Undefined();
+    ValueImp *v1 = base->getPropertySlot(exec, propertyName, slot) ? slot.getValue(exec, propertyName) : jsUndefined();
     KJS_CHECKEXCEPTIONVALUE
     ValueImp *v2 = m_right->evaluate(exec);
     v = valueForReadModifyAssignment(exec, v1, v2, m_oper);
@@ -1466,7 +1466,7 @@ ValueImp *VarDeclNode::evaluate(ExecState *exec)
       // built-in properties of the global object with var declarations.
       if (variable->getDirect(ident)) 
           return 0;
-      val = Undefined();
+      val = jsUndefined();
   }
 
 #ifdef KJS_VERBOSE
@@ -1496,7 +1496,7 @@ void VarDeclNode::processVarDecls(ExecState *exec)
       flags |= DontDelete;
     if (varType == VarDeclNode::Constant)
       flags |= ReadOnly;
-    variable->put(exec, ident, Undefined(), flags);
+    variable->put(exec, ident, jsUndefined(), flags);
   }
 }
 
@@ -1509,7 +1509,7 @@ ValueImp *VarDeclListNode::evaluate(ExecState *exec)
     n->var->evaluate(exec);
     KJS_CHECKEXCEPTIONVALUE
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 void VarDeclListNode::processVarDecls(ExecState *exec)
@@ -1918,7 +1918,7 @@ Completion ReturnNode::execute(ExecState *exec)
   }
 
   if (!value)
-    return Completion(ReturnValue, Undefined());
+    return Completion(ReturnValue, jsUndefined());
 
   ValueImp *v = value->evaluate(exec);
   KJS_CHECKEXCEPTION
@@ -1966,7 +1966,7 @@ Completion CaseClauseNode::evalStatements(ExecState *exec)
   if (list)
     return list->execute(exec);
   else
-    return Completion(Normal, Undefined());
+    return Completion(Normal, jsUndefined());
 }
 
 void CaseClauseNode::processVarDecls(ExecState *exec)
@@ -2191,7 +2191,7 @@ void TryNode::processVarDecls(ExecState *exec)
 // ECMA 13
 ValueImp *ParameterNode::evaluate(ExecState *)
 {
-  return Undefined();
+  return jsUndefined();
 }
 
 // ------------------------------ FunctionBodyNode -----------------------------
@@ -2226,7 +2226,7 @@ void FuncDeclNode::processFuncDecl(ExecState *exec)
   for(ParameterNode *p = param.get(); p != 0L; p = p->nextParam(), plen++)
     func->addParameter(p->ident());
 
-  func->put(exec, lengthPropertyName, Number(plen), ReadOnly|DontDelete|DontEnum);
+  func->put(exec, lengthPropertyName, jsNumber(plen), ReadOnly|DontDelete|DontEnum);
 
   // ECMA 10.2.2
   context->variableObject()->put(exec, ident, func, Internal | (context->codeType() == EvalCode ? 0 : DontDelete));
index b1e7abe..2c2a28d 100644 (file)
@@ -134,7 +134,7 @@ namespace KJS {
   protected:
     LabelStack ls;
   private:
-    ValueImp *evaluate(ExecState */*exec*/) { return Undefined(); }
+    ValueImp *evaluate(ExecState */*exec*/) { return jsUndefined(); }
     int l0, l1;
     int sid;
     bool breakPoint;
index 377d932..d9c6f96 100644 (file)
@@ -53,7 +53,7 @@ NumberPrototypeImp::NumberPrototypeImp(ExecState *exec,
                                        FunctionPrototypeImp *funcProto)
   : NumberInstanceImp(objProto)
 {
-  setInternalValue(jsZero());
+  setInternalValue(jsNumber(0));
 
   // The constructor will be added later, after NumberObjectImp has been constructed
 
@@ -148,14 +148,14 @@ ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
         *--p = "0123456789abcdefghijklmnopqrstuvwxyz"[i % radix];
         i /= radix;
       } while (i);
-      return String(p);
+      return jsString(p);
     } else
-      return String(v->toString(exec));
+      return jsString(v->toString(exec));
   }
   case ToLocaleString: /* TODO */
-    return String(v->toString(exec));
+    return jsString(v->toString(exec));
   case ValueOf:
-    return Number(v->toNumber(exec));
+    return jsNumber(v->toNumber(exec));
   case ToFixed: 
   {
       ValueImp *fractionDigits = args[0];
@@ -166,7 +166,7 @@ ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       
       double x = v->toNumber(exec);
       if (isNaN(x))
-          return String("NaN");
+          return jsString("NaN");
       
       UString s = "";
       if (x < 0) {
@@ -175,7 +175,7 @@ ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       }
       
       if (x >= pow(10.0, 21.0))
-          return String(s+UString::from(x));
+          return jsString(s+UString::from(x));
       
       double n = floor(x*pow(10.0, f));
       if (fabs(n / pow(10.0, f) - x) > fabs((n + 1) / pow(10.0, f) - x))
@@ -193,15 +193,15 @@ ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
           assert(k == m.size());
       }
       if (k-f < m.size())
-          return String(s+m.substr(0,k-f)+"."+m.substr(k-f));
+          return jsString(s+m.substr(0,k-f)+"."+m.substr(k-f));
       else
-          return String(s+m.substr(0,k-f));
+          return jsString(s+m.substr(0,k-f));
   }
   case ToExponential: {
       double x = v->toNumber(exec);
       
       if (isNaN(x) || isInf(x))
-          return String(UString::from(x));
+          return jsString(UString::from(x));
       
       ValueImp *fractionDigits = args[0];
       double df = fractionDigits->toInteger(exec);
@@ -229,7 +229,7 @@ ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       int sign;
       
       if (isNaN(x))
-          return String("NaN");
+          return jsString("NaN");
       
       char *result = kjs_dtoa(x, 0, 0, &decimalPoint, &sign, NULL);
       int length = strlen(result);
@@ -285,7 +285,7 @@ ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       
       kjs_freedtoa(result);
       
-      return String(UString(buf));
+      return jsString(buf);
   }
   case ToPrecision:
   {
@@ -295,7 +295,7 @@ ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       double dp = args[0]->toInteger(exec);
       double x = v->toNumber(exec);
       if (isNaN(dp) || isNaN(x) || isInf(x))
-          return String(v->toString(exec));
+          return jsString(v->toString(exec));
       
       UString s = "";
       if (x < 0) {
@@ -325,9 +325,9 @@ ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
               if (m.size() > 1)
                   m = m.substr(0,1)+"."+m.substr(1);
               if (e >= 0)
-                  return String(s+m+"e+"+UString::from(e));
+                  return jsString(s+m+"e+"+UString::from(e));
               else
-                  return String(s+m+"e-"+UString::from(-e));
+                  return jsString(s+m+"e-"+UString::from(-e));
           }
       }
       else {
@@ -336,16 +336,16 @@ ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       }
       
       if (e == p-1) {
-          return String(s+m);
+          return jsString(s+m);
       }
       else if (e >= 0) {
           if (e+1 < m.size())
-              return String(s+m.substr(0,e+1)+"."+m.substr(e+1));
+              return jsString(s+m.substr(0,e+1)+"."+m.substr(e+1));
           else
-              return String(s+m.substr(0,e+1));
+              return jsString(s+m.substr(0,e+1));
       }
       else {
-          return String(s+"0."+char_sequence('0',-(e+1))+m);
+          return jsString(s+"0."+char_sequence('0',-(e+1))+m);
       }
    }
       
@@ -375,7 +375,7 @@ NumberObjectImp::NumberObjectImp(ExecState *exec,
   putDirect(prototypePropertyName, numberProto,DontEnum|DontDelete|ReadOnly);
 
   // no. of arguments for constructor
-  putDirect(lengthPropertyName, jsOne(), ReadOnly|DontDelete|DontEnum);
+  putDirect(lengthPropertyName, jsNumber(1), ReadOnly|DontDelete|DontEnum);
 }
 
 bool NumberObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -390,15 +390,15 @@ ValueImp *NumberObjectImp::getValueProperty(ExecState *, int token) const
   case NaNValue:
     return jsNaN();
   case NegInfinity:
-    return Number(-Inf);
+    return jsNumber(-Inf);
   case PosInfinity:
-    return Number(Inf);
+    return jsNumber(Inf);
   case MaxValue:
-    return Number(1.7976931348623157E+308);
+    return jsNumber(1.7976931348623157E+308);
   case MinValue:
-    return Number(5E-324);
+    return jsNumber(5E-324);
   }
-  return Null();
+  return jsNull();
 }
 
 bool NumberObjectImp::implementsConstruct() const
@@ -433,7 +433,7 @@ bool NumberObjectImp::implementsCall() const
 ValueImp *NumberObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
 {
   if (args.isEmpty())
-    return Number(0);
+    return jsNumber(0);
   else
-    return Number(args[0]->toNumber(exec));
+    return jsNumber(args[0]->toNumber(exec));
 }
index e2ca453..843474b 100644 (file)
@@ -155,7 +155,7 @@ ValueImp *ObjectImp::get(ExecState *exec, const Identifier &propertyName) const
   if (const_cast<ObjectImp *>(this)->getPropertySlot(exec, propertyName, slot))
     return slot.getValue(exec, propertyName);
     
-  return Undefined();
+  return jsUndefined();
 }
 
 ValueImp *ObjectImp::get(ExecState *exec, unsigned propertyName) const
@@ -164,7 +164,7 @@ ValueImp *ObjectImp::get(ExecState *exec, unsigned propertyName) const
   if (const_cast<ObjectImp *>(this)->getPropertySlot(exec, propertyName, slot))
     return slot.getValue(exec, propertyName);
     
-  return Undefined();
+  return jsUndefined();
 }
 
 bool ObjectImp::getPropertySlot(ExecState *exec, unsigned propertyName, PropertySlot& slot)
@@ -511,12 +511,12 @@ ObjectImp *Error::create(ExecState *exec, ErrorType errtype, const UString &mess
   ObjectImp *err = static_cast<ObjectImp *>(cons->construct(exec,args));
 
   if (lineno != -1)
-    err->put(exec, "line", Number(lineno));
+    err->put(exec, "line", jsNumber(lineno));
   if (sourceId != -1)
-    err->put(exec, "sourceId", Number(sourceId));
+    err->put(exec, "sourceId", jsNumber(sourceId));
 
   if(sourceURL)
-   err->put(exec,"sourceURL", String(*sourceURL));
+   err->put(exec,"sourceURL", jsString(*sourceURL));
  
   return err;
 
index 4e15b58..fdbf68e 100644 (file)
@@ -36,7 +36,7 @@ using namespace KJS;
 
 ObjectPrototypeImp::ObjectPrototypeImp(ExecState *exec,
                                        FunctionPrototypeImp *funcProto)
-  : ObjectImp() // [[Prototype]] is Null()
+  : ObjectImp() // [[Prototype]] is null
 {
     putDirect(toStringPropertyName, new ObjectProtoFuncImp(exec, funcProto, ObjectProtoFuncImp::ToString,               0), DontEnum);
     putDirect(toLocaleStringPropertyName, new ObjectProtoFuncImp(exec, funcProto, ObjectProtoFuncImp::ToLocaleString,   0), DontEnum);
@@ -79,7 +79,7 @@ ValueImp *ObjectProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
             return jsString(thisObj->toString(exec));
         case ToString:
         default:
-            return String("[object " + thisObj->className() + "]");
+            return jsString("[object " + thisObj->className() + "]");
     }
 }
 
@@ -94,7 +94,7 @@ ObjectObjectImp::ObjectObjectImp(ExecState *exec,
   putDirect(prototypePropertyName, objProto, DontEnum|DontDelete|ReadOnly);
 
   // no. of arguments for constructor
-  putDirect(lengthPropertyName, jsOne(), ReadOnly|DontDelete|DontEnum);
+  putDirect(lengthPropertyName, jsNumber(1), ReadOnly|DontDelete|DontEnum);
 }
 
 
index 4a7f4be..04da5f2 100644 (file)
@@ -28,7 +28,7 @@ namespace KJS {
 
 ValueImp *PropertySlot::undefinedGetter(ExecState *, const Identifier& propertyName, const PropertySlot& slot)
 {
-    return Undefined();
+    return jsUndefined();
 }
 
 }
index af6a514..c03d0f6 100644 (file)
@@ -49,7 +49,7 @@ RegExpPrototypeImp::RegExpPrototypeImp(ExecState *exec,
                                        FunctionPrototypeImp *funcProto)
   : ObjectImp(objProto)
 {
-  setInternalValue(String(""));
+  setInternalValue(jsString(""));
 
   // The constructor will be added later in RegExpObject's constructor (?)
 
@@ -79,7 +79,7 @@ ValueImp *RegExpProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
   if (!thisObj->inherits(&RegExpImp::info)) {
     if (thisObj->inherits(&RegExpPrototypeImp::info)) {
       switch (id) {
-        case ToString: return String("//");
+        case ToString: return jsString("//");
       }
     }
     
@@ -105,8 +105,8 @@ ValueImp *RegExpProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
     if (!globalFlag)
       lastIndex = 0;
     if (lastIndex < 0 || lastIndex > input.size()) {
-      thisObj->put(exec, "lastIndex", jsZero(), DontDelete | DontEnum);
-      return Null();
+      thisObj->put(exec, "lastIndex", jsNumber(0), DontDelete | DontEnum);
+      return jsNull();
     }
 
     int foundIndex;
@@ -115,17 +115,17 @@ ValueImp *RegExpProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
 
     // Test
     if (id == Test)
-      return Boolean(didMatch);
+      return jsBoolean(didMatch);
 
     // Exec
     if (didMatch) {
       if (globalFlag)
-        thisObj->put(exec, "lastIndex", Number(foundIndex + match.size()), DontDelete | DontEnum);
+        thisObj->put(exec, "lastIndex", jsNumber(foundIndex + match.size()), DontDelete | DontEnum);
       return regExpObj->arrayOfMatches(exec, match);
     } else {
       if (globalFlag)
-        thisObj->put(exec, "lastIndex", jsZero(), DontDelete | DontEnum);
-      return Null();
+        thisObj->put(exec, "lastIndex", jsNumber(0), DontDelete | DontEnum);
+      return jsNull();
     }
   }
   break;
@@ -140,10 +140,10 @@ ValueImp *RegExpProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
     if (thisObj->get(exec, "multiline")->toBoolean(exec)) {
       result += "m";
     }
-    return String(result);
+    return jsString(result);
   }
 
-  return Undefined();
+  return jsUndefined();
 }
 
 // ------------------------------ RegExpImp ------------------------------------
@@ -200,7 +200,7 @@ RegExpObjectImp::RegExpObjectImp(ExecState *exec,
   putDirect(prototypePropertyName, regProto, DontEnum|DontDelete|ReadOnly);
 
   // no. of arguments for constructor
-  putDirect(lengthPropertyName, jsTwo(), ReadOnly|DontDelete|DontEnum);
+  putDirect(lengthPropertyName, jsNumber(2), ReadOnly|DontDelete|DontEnum);
 }
 
 RegExpObjectImp::~RegExpObjectImp()
@@ -240,7 +240,7 @@ ObjectImp *RegExpObjectImp::arrayOfMatches(ExecState *exec, const UString &resul
 {
   List list;
   // The returned array contains 'result' as first item, followed by the list of matches
-  list.append(String(result));
+  list.append(jsString(result));
   if ( lastOvector )
     for ( unsigned i = 1 ; i < lastNumSubPatterns + 1 ; ++i )
     {
@@ -249,12 +249,12 @@ ObjectImp *RegExpObjectImp::arrayOfMatches(ExecState *exec, const UString &resul
         list.append(jsUndefined());
       else {
         UString substring = lastInput.substr( start, lastOvector[2*i+1] - start );
-        list.append(String(substring));
+        list.append(jsString(substring));
       }
     }
   ObjectImp *arr = exec->lexicalInterpreter()->builtinArray()->construct(exec, list);
-  arr->put(exec, "index", Number(lastOvector[0]));
-  arr->put(exec, "input", String(lastInput));
+  arr->put(exec, "index", jsNumber(lastOvector[0]));
+  arr->put(exec, "input", jsString(lastInput));
   return arr;
 }
 
@@ -262,20 +262,20 @@ ValueImp *RegExpObjectImp::getBackref(unsigned i) const
 {
   if (lastOvector && i < lastNumSubPatterns + 1) {
     UString substring = lastInput.substr(lastOvector[2*i], lastOvector[2*i+1] - lastOvector[2*i] );
-    return String(substring);
+    return jsString(substring);
   } 
 
-  return String("");
+  return jsString("");
 }
 
 ValueImp *RegExpObjectImp::getLastMatch() const
 {
   if (lastOvector) {
     UString substring = lastInput.substr(lastOvector[0], lastOvector[1] - lastOvector[0]);
-    return String(substring);
+    return jsString(substring);
   }
   
-  return String("");
+  return jsString("");
 }
 
 ValueImp *RegExpObjectImp::getLastParen() const
@@ -284,20 +284,20 @@ ValueImp *RegExpObjectImp::getLastParen() const
   if (i > 0) {
     assert(lastOvector);
     UString substring = lastInput.substr(lastOvector[2*i], lastOvector[2*i+1] - lastOvector[2*i]);
-    return String(substring);
+    return jsString(substring);
   }
     
-  return String("");
+  return jsString("");
 }
 
 ValueImp *RegExpObjectImp::getLeftContext() const
 {
   if (lastOvector) {
     UString substring = lastInput.substr(0, lastOvector[0]);
-    return String(substring);
+    return jsString(substring);
   }
   
-  return String("");
+  return jsString("");
 }
 
 ValueImp *RegExpObjectImp::getRightContext() const
@@ -305,10 +305,10 @@ ValueImp *RegExpObjectImp::getRightContext() const
   if (lastOvector) {
     UString s = lastInput;
     UString substring = s.substr(lastOvector[1], s.size() - lastOvector[1]);
-    return String(substring);
+    return jsString(substring);
   }
   
-  return String("");
+  return jsString("");
 }
 
 bool RegExpObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -353,7 +353,7 @@ ValueImp *RegExpObjectImp::getValueProperty(ExecState *exec, int token) const
       assert(0);
   }
 
-  return String("");
+  return jsString("");
 }
 
 void RegExpObjectImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
@@ -406,7 +406,7 @@ ObjectImp *RegExpObjectImp::construct(ExecState *exec, const List &args)
   dat->putDirect("multiline", jsBoolean(multiline), DontDelete | ReadOnly | DontEnum);
 
   dat->putDirect("source", jsString(p), DontDelete | ReadOnly | DontEnum);
-  dat->putDirect("lastIndex", jsZero(), DontDelete | DontEnum);
+  dat->putDirect("lastIndex", jsNumber(0), DontDelete | DontEnum);
 
   int reflags = RegExp::None;
   if (global)
index 8283bc1..b6b2618 100644 (file)
@@ -43,13 +43,13 @@ const ClassInfo StringInstanceImp::info = {"String", 0, 0, 0};
 StringInstanceImp::StringInstanceImp(ObjectImp *proto)
   : ObjectImp(proto)
 {
-  setInternalValue(String(""));
+  setInternalValue(jsString(""));
 }
 
 StringInstanceImp::StringInstanceImp(ObjectImp *proto, const UString &string)
   : ObjectImp(proto)
 {
-  setInternalValue(String(string));
+  setInternalValue(jsString(string));
 }
 
 ValueImp *StringInstanceImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot &slot)
@@ -145,7 +145,7 @@ StringPrototypeImp::StringPrototypeImp(ExecState *exec,
   : StringInstanceImp(objProto)
 {
   // The constructor will be added later, after StringObjectImp has been built
-  putDirect(lengthPropertyName, jsZero(), DontDelete|ReadOnly|DontEnum);
+  putDirect(lengthPropertyName, jsNumber(0), DontDelete|ReadOnly|DontEnum);
 }
 
 bool StringPrototypeImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot &slot)
@@ -338,7 +338,7 @@ static ValueImp *replace(ExecState *exec, const UString &source, ValueImp *patte
     delete [] sourceRanges;
     delete [] replacements;
 
-    return String(result);
+    return jsString(result);
   }
   
   // First arg is a string
@@ -347,7 +347,7 @@ static ValueImp *replace(ExecState *exec, const UString &source, ValueImp *patte
   int matchLen = patternString.size();
   // Do the replacement
   if (matchPos == -1)
-    return String(source);
+    return jsString(source);
   
   if (replacementFunction) {
       List args;
@@ -360,7 +360,7 @@ static ValueImp *replace(ExecState *exec, const UString &source, ValueImp *patte
                                                     args)->toString(exec);
   }
 
-  return String(source.substr(0, matchPos) + replacementString + source.substr(matchPos + matchLen));
+  return jsString(source.substr(0, matchPos) + replacementString + source.substr(matchPos + matchLen));
 }
 
 // ECMA 15.5.4.2 - 15.5.4.20
@@ -373,7 +373,7 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
     if (!thisObj || !thisObj->inherits(&StringInstanceImp::info))
       return throwError(exec, TypeError);
 
-    return String(thisObj->internalValue()->toString(exec));
+    return jsString(thisObj->internalValue()->toString(exec));
   }
 
   UString u, u2, u3;
@@ -400,14 +400,14 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       u = s.substr(static_cast<int>(dpos), 1);
     else
       u = "";
-    result = String(u);
+    result = jsString(u);
     break;
   case CharCodeAt:
     // Other browsers treat an omitted parameter as 0 rather than NaN.
     // That doesn't match the ECMA standard, but is needed for site compatibility.
     dpos = a0->isUndefined() ? 0 : a0->toInteger(exec);
     if (dpos >= 0 && dpos < len) // false for NaN
-      result = Number(s[static_cast<int>(dpos)].unicode());
+      result = jsNumber(s[static_cast<int>(dpos)].unicode());
     else
       result = jsNaN();
     break;
@@ -416,7 +416,7 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
     for ( ; it != args.end() ; ++it) {
         s += it->toString(exec);
     }
-    result = String(s);
+    result = jsString(s);
     break;
   }
   case IndexOf:
@@ -431,7 +431,7 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       } else
         dpos = 0;
     }
-    result = Number(s.find(u2, static_cast<int>(dpos)));
+    result = jsNumber(s.find(u2, static_cast<int>(dpos)));
     break;
   case LastIndexOf:
     u2 = a0->toString(exec);
@@ -446,7 +446,7 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       } else
         dpos = 0;
     }
-    result = Number(s.rfind(u2, static_cast<int>(dpos)));
+    result = jsNumber(s.rfind(u2, static_cast<int>(dpos)));
     break;
   case Match:
   case Search: {
@@ -467,13 +467,13 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
     RegExpObjectImp* regExpObj = static_cast<RegExpObjectImp*>(exec->lexicalInterpreter()->builtinRegExp());
     UString mstr = regExpObj->performMatch(reg, u, 0, &pos);
     if (id == Search) {
-      result = Number(pos);
+      result = jsNumber(pos);
     } else {
       // Exec
       if ((reg->flags() & RegExp::Global) == 0) {
        // case without 'g' flag is handled like RegExp.prototype.exec
        if (mstr.isNull()) {
-         result = Null();
+         result = jsNull();
        } else {
          result = regExpObj->arrayOfMatches(exec,mstr);
        }
@@ -485,18 +485,18 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
           if (mstr.isNull())
             list.append(jsUndefined());
           else
-           list.append(String(mstr));
+           list.append(jsString(mstr));
          lastIndex = pos;
          pos += mstr.isEmpty() ? 1 : mstr.size();
          mstr = regExpObj->performMatch(reg, u, pos, &pos);
        }
        if (imp)
-         imp->put(exec, "lastIndex", Number(lastIndex), DontDelete|DontEnum);
+         imp->put(exec, "lastIndex", jsNumber(lastIndex), DontDelete|DontEnum);
        if (list.isEmpty()) {
          // if there are no matches at all, it's important to return
          // Null instead of an empty array, because this matches
          // other browsers and because Null is a false value.
-         result = Null(); 
+         result = jsNull(); 
        } else {
          result = exec->lexicalInterpreter()->builtinArray()->construct(exec, list);
        }
@@ -520,9 +520,9 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
           from = 0;
         if (to > len)
           to = len;
-        result = String(s.substr(static_cast<int>(from), static_cast<int>(to - from)));
+        result = jsString(s.substr(static_cast<int>(from), static_cast<int>(to - from)));
       } else {
-        result = String("");
+        result = jsString("");
       }
       break;
     }
@@ -538,7 +538,7 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       RegExp reg(obj0->get(exec,"source")->toString(exec));
       if (u.isEmpty() && !reg.match(u, 0).isNull()) {
        // empty string matched by regexp -> empty array
-       res->put(exec,lengthPropertyName, Number(0));
+       res->put(exec,lengthPropertyName, jsNumber(0));
        break;
       }
       pos = 0;
@@ -552,7 +552,7 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
          break;
        pos = mpos + (mstr.isEmpty() ? 1 : mstr.size());
        if (mpos != p0 || !mstr.isEmpty()) {
-         res->put(exec,i, String(u.substr(p0, mpos-p0)));
+         res->put(exec,i, jsString(u.substr(p0, mpos-p0)));
          p0 = mpos + mstr.size();
          i++;
        }
@@ -562,15 +562,15 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       if (u2.isEmpty()) {
        if (u.isEmpty()) {
          // empty separator matches empty string -> empty array
-         put(exec,lengthPropertyName, Number(0));
+         put(exec,lengthPropertyName, jsNumber(0));
          break;
        } else {
          while (static_cast<uint32_t>(i) != limit && i < u.size()-1)
-           res->put(exec, i++, String(u.substr(p0++, 1)));
+           res->put(exec, i++, jsString(u.substr(p0++, 1)));
        }
       } else {
        while (static_cast<uint32_t>(i) != limit && (pos = u.find(u2, p0)) >= 0) {
-         res->put(exec, i, String(u.substr(p0, pos-p0)));
+         res->put(exec, i, jsString(u.substr(p0, pos-p0)));
          p0 = pos + u2.size();
          i++;
        }
@@ -578,8 +578,8 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
     }
     // add remaining string, if any
     if (static_cast<uint32_t>(i) != limit)
-      res->put(exec, i++, String(u.substr(p0)));
-    res->put(exec,lengthPropertyName, Number(i));
+      res->put(exec, i++, jsString(u.substr(p0)));
+    res->put(exec,lengthPropertyName, jsNumber(i));
     }
     break;
   case Substr: {
@@ -598,7 +598,7 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       if (d2 > len - d)
         d2 = len - d;
     }
-    result = String(s.substr(static_cast<int>(d), static_cast<int>(d2)));
+    result = jsString(s.substr(static_cast<int>(d), static_cast<int>(d2)));
     break;
   }
   case Substring: {
@@ -623,7 +623,7 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
       end = start;
       start = temp;
     }
-    result = String(s.substr((int)start, (int)end-(int)start));
+    result = jsString(s.substr((int)start, (int)end-(int)start));
     }
     break;
   case ToLowerCase:
@@ -631,54 +631,54 @@ ValueImp *StringProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj
     u = s;
     for (i = 0; i < len; i++)
       u[i] = u[i].toLower();
-    result = String(u);
+    result = jsString(u);
     break;
   case ToUpperCase:
   case ToLocaleUpperCase: // FIXME: To get this 100% right we need to detect Turkish and change i to uppercase I with a dot.
     u = s;
     for (i = 0; i < len; i++)
       u[i] = u[i].toUpper();
-    result = String(u);
+    result = jsString(u);
     break;
 #ifndef KJS_PURE_ECMA
   case Big:
-    result = String("<big>" + s + "</big>");
+    result = jsString("<big>" + s + "</big>");
     break;
   case Small:
-    result = String("<small>" + s + "</small>");
+    result = jsString("<small>" + s + "</small>");
     break;
   case Blink:
-    result = String("<blink>" + s + "</blink>");
+    result = jsString("<blink>" + s + "</blink>");
     break;
   case Bold:
-    result = String("<b>" + s + "</b>");
+    result = jsString("<b>" + s + "</b>");
     break;
   case Fixed:
-    result = String("<tt>" + s + "</tt>");
+    result = jsString("<tt>" + s + "</tt>");
     break;
   case Italics:
-    result = String("<i>" + s + "</i>");
+    result = jsString("<i>" + s + "</i>");
     break;
   case Strike:
-    result = String("<strike>" + s + "</strike>");
+    result = jsString("<strike>" + s + "</strike>");
     break;
   case Sub:
-    result = String("<sub>" + s + "</sub>");
+    result = jsString("<sub>" + s + "</sub>");
     break;
   case Sup:
-    result = String("<sup>" + s + "</sup>");
+    result = jsString("<sup>" + s + "</sup>");
     break;
   case Fontcolor:
-    result = String("<font color=\"" + a0->toString(exec) + "\">" + s + "</font>");
+    result = jsString("<font color=\"" + a0->toString(exec) + "\">" + s + "</font>");
     break;
   case Fontsize:
-    result = String("<font size=\"" + a0->toString(exec) + "\">" + s + "</font>");
+    result = jsString("<font size=\"" + a0->toString(exec) + "\">" + s + "</font>");
     break;
   case Anchor:
-    result = String("<a name=\"" + a0->toString(exec) + "\">" + s + "</a>");
+    result = jsString("<a name=\"" + a0->toString(exec) + "\">" + s + "</a>");
     break;
   case Link:
-    result = String("<a href=\"" + a0->toString(exec) + "\">" + s + "</a>");
+    result = jsString("<a href=\"" + a0->toString(exec) + "\">" + s + "</a>");
     break;
 #endif
   }
@@ -699,7 +699,7 @@ StringObjectImp::StringObjectImp(ExecState *exec,
   putDirect(fromCharCodePropertyName, new StringObjectFuncImp(exec, funcProto), DontEnum);
 
   // no. of arguments for constructor
-  putDirect(lengthPropertyName, jsOne(), ReadOnly|DontDelete|DontEnum);
+  putDirect(lengthPropertyName, jsNumber(1), ReadOnly|DontDelete|DontEnum);
 }
 
 
@@ -726,10 +726,10 @@ bool StringObjectImp::implementsCall() const
 ValueImp *StringObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
 {
   if (args.isEmpty())
-    return String("");
+    return jsString("");
   else {
     ValueImp *v = args[0];
-    return String(v->toString(exec));
+    return jsString(v->toString(exec));
   }
 }
 
@@ -739,7 +739,7 @@ ValueImp *StringObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*
 StringObjectFuncImp::StringObjectFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto)
   : InternalFunctionImp(funcProto)
 {
-  putDirect(lengthPropertyName, jsOne(), DontDelete|ReadOnly|DontEnum);
+  putDirect(lengthPropertyName, jsNumber(1), DontDelete|ReadOnly|DontEnum);
 }
 
 bool StringObjectFuncImp::implementsCall() const
@@ -763,5 +763,5 @@ ValueImp *StringObjectFuncImp::callAsFunction(ExecState *exec, ObjectImp */*this
   } else
     s = "";
 
-  return String(s);
+  return jsString(s);
 }
index 7e4cc50..515c490 100644 (file)
@@ -58,10 +58,10 @@ ValueImp *TestFunctionImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*
   case Print:
   case Debug:
     fprintf(stderr,"--> %s\n",args[0]->toString(exec).ascii());
-    return Undefined();
+    return jsUndefined();
   case Quit:
     exit(0);
-    return Undefined();
+    return jsUndefined();
   case GC:
   {
     JSLock lock;
@@ -72,7 +72,7 @@ ValueImp *TestFunctionImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*
     break;
   }
 
-  return Undefined();
+  return jsUndefined();
 }
 
 class VersionFunctionImp : public ObjectImp {
@@ -86,7 +86,7 @@ ValueImp *VersionFunctionImp::callAsFunction(ExecState */*exec*/, ObjectImp */*t
 {
   // We need this function for compatibility with the Mozilla JS tests but for now
   // we don't actually do any version-specific handling
-  return Undefined();
+  return jsUndefined();
 }
 
 class GlobalImp : public ObjectImp {
index 70598ef..7d884f9 100644 (file)
@@ -175,13 +175,10 @@ private:
 AllocatedValueImp *jsUndefined();
 AllocatedValueImp *jsNull();
 
-AllocatedValueImp *jsBoolean(bool = false);
+AllocatedValueImp *jsBoolean(bool);
 
 ValueImp *jsNumber(double);
 ValueImp *jsNaN();
-ValueImp *jsZero();
-ValueImp *jsOne();
-ValueImp *jsTwo();
 
 AllocatedValueImp *jsString(const UString &); // returns empty string if passed null string
 AllocatedValueImp *jsString(const char * = ""); // returns empty string if passed 0
@@ -418,30 +415,6 @@ inline UString ValueImp::toString(ExecState *exec) const
     return downcast()->toString(exec);
 }
 
-inline ValueImp *jsZero()
-{
-    return SimpleNumber::make(0.0);
-}
-
-inline ValueImp *jsOne()
-{
-    return SimpleNumber::make(1.0);
-}
-
-inline ValueImp *jsTwo()
-{
-    return SimpleNumber::make(2.0);
-}
-
-// compatibility names so we don't have to change so much code
-
-inline AllocatedValueImp *Undefined() { return jsUndefined(); }
-inline AllocatedValueImp *Null() { return jsNull(); }
-inline AllocatedValueImp *Boolean(bool b) { return jsBoolean(b); }
-inline ValueImp *Number(double n) { return jsNumber(n); }
-inline AllocatedValueImp *String(const UString& s) { return jsString(s); }
-inline AllocatedValueImp *String(const char *s) { return jsString(s); }
-
 } // namespace
 
 #endif // KJS_VALUE_H
index b97d508..1c798ec 100644 (file)
@@ -1,3 +1,238 @@
+2005-12-10  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - eliminated the old Undefined(), Null(), Boolean(), Number(), and String()
+
+        Code now uses jsUndefined(), jsNull(), jsBoolean(), jsNumber(), and jsString().
+
+        * khtml/ecma/domparser.cpp:
+        (KJS::DOMParserProtoFunc::callAsFunction):
+        * khtml/ecma/kjs_binding.cpp:
+        (KJS::jsStringOrNull):
+        (KJS::setDOMException):
+        * khtml/ecma/kjs_binding.h:
+        (KJS::DOMFunction::toPrimitive):
+        * khtml/ecma/kjs_css.cpp:
+        (KJS::DOMCSSStyleDeclaration::indexGetter):
+        (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
+        (KJS::DOMCSSStyleDeclaration::getValueProperty):
+        (KJS::DOMCSSStyleDeclarationProtoFunc::callAsFunction):
+        (KJS::DOMStyleSheet::getValueProperty):
+        (KJS::getDOMStyleSheet):
+        (KJS::DOMStyleSheetList::getValueProperty):
+        (KJS::getDOMStyleSheetList):
+        (KJS::DOMStyleSheetListFunc::callAsFunction):
+        (KJS::DOMMediaList::getValueProperty):
+        (KJS::DOMMediaList::indexGetter):
+        (KJS::KJS::DOMMediaListProtoFunc::callAsFunction):
+        (KJS::DOMCSSStyleSheet::getValueProperty):
+        (KJS::DOMCSSStyleSheetProtoFunc::callAsFunction):
+        (KJS::DOMCSSRuleList::getValueProperty):
+        (KJS::DOMCSSRuleListFunc::callAsFunction):
+        (KJS::DOMCSSRule::getValueProperty):
+        (KJS::DOMCSSRuleFunc::callAsFunction):
+        (KJS::CSSRuleConstructor::getValueProperty):
+        (KJS::DOMCSSValue::getValueProperty):
+        (KJS::getDOMCSSValue):
+        (KJS::CSSValueConstructor::getValueProperty):
+        (KJS::DOMCSSPrimitiveValue::getValueProperty):
+        (KJS::DOMCSSPrimitiveValueProtoFunc::callAsFunction):
+        (KJS::CSSPrimitiveValueConstructor::getValueProperty):
+        (KJS::DOMCSSValueList::getValueProperty):
+        (KJS::DOMCSSValueListFunc::callAsFunction):
+        (KJS::DOMCounter::getValueProperty):
+        * khtml/ecma/kjs_dom.cpp:
+        (KJS::DOMNode::getValueProperty):
+        (KJS::DOMNode::toPrimitive):
+        (KJS::DOMNode::getListener):
+        (KJS::DOMNodeProtoFunc::callAsFunction):
+        (KJS::DOMNodeList::toPrimitive):
+        (KJS::DOMNodeList::getValueProperty):
+        (KJS::DOMNodeList::callAsFunction):
+        (KJS::DOMAttr::getValueProperty):
+        (KJS::DOMDocument::getValueProperty):
+        (KJS::DOMDocumentProtoFunc::callAsFunction):
+        (KJS::DOMElement::getValueProperty):
+        (KJS::DOMElement::attributeGetter):
+        (KJS::DOMElementProtoFunc::callAsFunction):
+        (KJS::DOMDOMImplementationProtoFunc::callAsFunction):
+        (KJS::DOMDocumentType::getValueProperty):
+        (KJS::DOMNamedNodeMap::lengthGetter):
+        (KJS::DOMNamedNodeMapProtoFunc::callAsFunction):
+        (KJS::DOMProcessingInstruction::getValueProperty):
+        (KJS::DOMNotation::getValueProperty):
+        (KJS::DOMEntity::getValueProperty):
+        (KJS::getDOMNode):
+        (KJS::NodeConstructor::getValueProperty):
+        (KJS::DOMExceptionConstructor::getValueProperty):
+        (KJS::DOMNamedNodesCollection::lengthGetter):
+        (KJS::DOMCharacterData::getValueProperty):
+        (KJS::DOMCharacterDataProtoFunc::callAsFunction):
+        (KJS::DOMTextProtoFunc::callAsFunction):
+        * khtml/ecma/kjs_events.cpp:
+        (KJS::JSLazyEventListener::parseCode):
+        (KJS::EventConstructor::getValueProperty):
+        (KJS::DOMEvent::getValueProperty):
+        (KJS::DOMEventProtoFunc::callAsFunction):
+        (KJS::getDOMEvent):
+        (KJS::EventExceptionConstructor::getValueProperty):
+        (KJS::DOMUIEvent::getValueProperty):
+        (KJS::DOMUIEventProtoFunc::callAsFunction):
+        (KJS::DOMMouseEvent::getValueProperty):
+        (KJS::DOMMouseEventProtoFunc::callAsFunction):
+        (KJS::DOMKeyboardEvent::getValueProperty):
+        (KJS::DOMKeyboardEventProtoFunc::callAsFunction):
+        (KJS::MutationEventConstructor::getValueProperty):
+        (KJS::DOMMutationEvent::getValueProperty):
+        (KJS::DOMMutationEventProtoFunc::callAsFunction):
+        (KJS::DOMWheelEvent::getValueProperty):
+        (KJS::DOMWheelEventProtoFunc::callAsFunction):
+        (KJS::stringOrUndefined):
+        (KJS::Clipboard::getValueProperty):
+        (KJS::ClipboardProtoFunc::callAsFunction):
+        * khtml/ecma/kjs_html.cpp:
+        (KJS::KJS::HTMLDocFunction::callAsFunction):
+        (KJS::HTMLDocument::getValueProperty):
+        (KJS::HTMLElement::framesetNameGetter):
+        (KJS::HTMLElement::frameWindowPropertyGetter):
+        (KJS::HTMLElement::runtimeObjectPropertyGetter):
+        (KJS::KJS::HTMLElement::callAsFunction):
+        (KJS::HTMLElement::htmlGetter):
+        (KJS::HTMLElement::headGetter):
+        (KJS::HTMLElement::linkGetter):
+        (KJS::HTMLElement::titleGetter):
+        (KJS::HTMLElement::metaGetter):
+        (KJS::HTMLElement::baseGetter):
+        (KJS::HTMLElement::isIndexGetter):
+        (KJS::HTMLElement::styleGetter):
+        (KJS::HTMLElement::bodyGetter):
+        (KJS::HTMLElement::formGetter):
+        (KJS::HTMLElement::selectGetter):
+        (KJS::HTMLElement::optGroupGetter):
+        (KJS::HTMLElement::optionGetter):
+        (KJS::getInputSelectionStart):
+        (KJS::getInputSelectionEnd):
+        (KJS::HTMLElement::inputGetter):
+        (KJS::HTMLElement::textAreaGetter):
+        (KJS::HTMLElement::buttonGetter):
+        (KJS::HTMLElement::labelGetter):
+        (KJS::HTMLElement::fieldSetGetter):
+        (KJS::HTMLElement::legendGetter):
+        (KJS::HTMLElement::uListGetter):
+        (KJS::HTMLElement::oListGetter):
+        (KJS::HTMLElement::dListGetter):
+        (KJS::HTMLElement::dirGetter):
+        (KJS::HTMLElement::menuGetter):
+        (KJS::HTMLElement::liGetter):
+        (KJS::HTMLElement::divGetter):
+        (KJS::HTMLElement::paragraphGetter):
+        (KJS::HTMLElement::headingGetter):
+        (KJS::HTMLElement::blockQuoteGetter):
+        (KJS::HTMLElement::quoteGetter):
+        (KJS::HTMLElement::preGetter):
+        (KJS::HTMLElement::brGetter):
+        (KJS::HTMLElement::baseFontGetter):
+        (KJS::HTMLElement::fontGetter):
+        (KJS::HTMLElement::hrGetter):
+        (KJS::HTMLElement::modGetter):
+        (KJS::HTMLElement::anchorGetter):
+        (KJS::HTMLElement::imageGetter):
+        (KJS::HTMLElement::objectGetter):
+        (KJS::HTMLElement::paramGetter):
+        (KJS::HTMLElement::appletGetter):
+        (KJS::HTMLElement::mapGetter):
+        (KJS::HTMLElement::areaGetter):
+        (KJS::HTMLElement::scriptGetter):
+        (KJS::HTMLElement::tableGetter):
+        (KJS::HTMLElement::tableCaptionGetter):
+        (KJS::HTMLElement::tableColGetter):
+        (KJS::HTMLElement::tableSectionGetter):
+        (KJS::HTMLElement::tableRowGetter):
+        (KJS::HTMLElement::tableCellGetter):
+        (KJS::HTMLElement::frameSetGetter):
+        (KJS::HTMLElement::frameGetter):
+        (KJS::HTMLElement::iFrameGetter):
+        (KJS::HTMLElement::marqueeGetter):
+        (KJS::HTMLElement::getValueProperty):
+        (KJS::HTMLElementFunction::HTMLElementFunction):
+        (KJS::KJS::HTMLElementFunction::callAsFunction):
+        (KJS::HTMLCollection::lengthGetter):
+        (KJS::KJS::HTMLCollection::callAsFunction):
+        (KJS::KJS::HTMLCollection::getNamedItems):
+        (KJS::KJS::HTMLCollectionProtoFunc::callAsFunction):
+        (KJS::HTMLSelectCollection::selectedIndexGetter):
+        (KJS::HTMLSelectCollection::getOwnPropertySlot):
+        (KJS::OptionConstructorImp::OptionConstructorImp):
+        (KJS::Image::getValueProperty):
+        (KJS::KJS::Context2DFunction::callAsFunction):
+        (KJS::Context2D::getValueProperty):
+        (KJS::Context2D::Context2D):
+        (KJS::GradientFunction::callAsFunction):
+        (KJS::Gradient::getValueProperty):
+        (KJS::ImagePattern::getValueProperty):
+        (KJS::getSelectHTMLCollection):
+        * khtml/ecma/kjs_navigator.cpp:
+        (KJS::Navigator::getValueProperty):
+        (KJS::Plugins::getValueProperty):
+        (KJS::Plugins::nameGetter):
+        (KJS::MimeTypes::getValueProperty):
+        (KJS::MimeTypes::nameGetter):
+        (KJS::Plugin::getValueProperty):
+        (KJS::Plugin::nameGetter):
+        (KJS::MimeType::getValueProperty):
+        (KJS::PluginsFunc::callAsFunction):
+        (KJS::NavigatorFunc::callAsFunction):
+        * khtml/ecma/kjs_proxy.cpp:
+        (TestFunctionImp::callAsFunction):
+        * khtml/ecma/kjs_range.cpp:
+        (KJS::DOMRange::getValueProperty):
+        (KJS::DOMRangeProtoFunc::callAsFunction):
+        (KJS::RangeConstructor::getValueProperty):
+        * khtml/ecma/kjs_traversal.cpp:
+        (KJS::DOMNodeIterator::getValueProperty):
+        (KJS::DOMNodeIteratorProtoFunc::callAsFunction):
+        (KJS::NodeFilterConstructor::getValueProperty):
+        (KJS::DOMNodeFilterProtoFunc::callAsFunction):
+        (KJS::DOMTreeWalker::getValueProperty):
+        (KJS::DOMTreeWalkerProtoFunc::callAsFunction):
+        * khtml/ecma/kjs_views.cpp:
+        (KJS::DOMAbstractViewProtoFunc::callAsFunction):
+        * khtml/ecma/kjs_window.cpp:
+        (KJS::Screen::getValueProperty):
+        (KJS::Window::retrieve):
+        (KJS::showModalDialog):
+        (KJS::Window::getValueProperty):
+        (KJS::Window::getListener):
+        (KJS::WindowFunc::callAsFunction):
+        (KJS::FrameArray::getValueProperty):
+        (KJS::FrameArray::indexGetter):
+        (KJS::FrameArray::nameGetter):
+        (KJS::Location::getValueProperty):
+        (KJS::Location::toPrimitive):
+        (KJS::LocationFunc::callAsFunction):
+        (KJS::Selection::getValueProperty):
+        (KJS::Selection::toPrimitive):
+        (KJS::SelectionFunc::callAsFunction):
+        (KJS::BarInfo::getValueProperty):
+        (KJS::History::getValueProperty):
+        (KJS::HistoryFunc::callAsFunction):
+        * khtml/ecma/xmlhttprequest.cpp:
+        (KJS::XMLHttpRequest::getValueProperty):
+        (KJS::XMLHttpRequest::getAllResponseHeaders):
+        (KJS::XMLHttpRequest::getResponseHeader):
+        (KJS::XMLHttpRequest::getStatus):
+        (KJS::XMLHttpRequest::getStatusText):
+        (KJS::XMLHttpRequestProtoFunc::callAsFunction):
+        * khtml/ecma/xmlserializer.cpp:
+        (KJS::XMLSerializerProtoFunc::callAsFunction):
+        * ksvg2/ecma/Ecma.cpp:
+        (KSVG::getSVGPathSeg):
+        * ksvg2/ecma/GlobalObject.cpp:
+        (GlobalObject::get):
+        * kwq/WebCoreScriptDebugger.mm:
+        (-[WebCoreScriptCallFrame evaluateWebScript:]):
+
 2005-12-10  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Darin and Tim Hatcher.
index 607f2d5..d4a0392 100644 (file)
@@ -98,7 +98,7 @@ ValueImp *DOMParserProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj
     }
   }
                
-  return Undefined();
+  return jsUndefined();
 }
 
 } // end namespace
index bcf6bb0..aebc1c6 100644 (file)
@@ -309,12 +309,11 @@ QString Identifier::qstring() const
   return QString((QChar*) data(), size());
 }
 
-ValueImp *getStringOrNull(DOMString s)
+ValueImp *jsStringOrNull(const DOMString &s)
 {
-  if (s.isNull())
-    return Null();
-  else
-    return String(s);
+    if (s.isNull())
+        return jsNull();
+    return jsString(s);
 }
 
 DOMString valueToStringWithNullCheck(ExecState *exec, ValueImp *val)
@@ -366,7 +365,7 @@ void setDOMException(ExecState *exec, int DOMExceptionCode)
   sprintf(buffer, "%s exception %d", type, code);
 
   ObjectImp *errorObject = throwError(exec, GeneralError, buffer);
-  errorObject->put(exec, "code", Number(code));
+  errorObject->put(exec, "code", jsNumber(code));
 }
 
 }
index 297644d..e4b3722 100644 (file)
@@ -57,7 +57,7 @@ namespace KJS {
   public:
     virtual bool implementsCall() const { return true; }
     virtual bool toBoolean(ExecState *) const { return true; }
-    virtual ValueImp *toPrimitive(ExecState *exec, Type) const { return String(toString(exec)); }
+    virtual ValueImp *toPrimitive(ExecState *exec, Type) const { return jsString(toString(exec)); }
     virtual UString toString(ExecState *) const { return UString("[function]"); }
   };
 
@@ -148,9 +148,9 @@ namespace KJS {
   };
 
   /**
-   *  Get a String object, or Null() if s is null
+   *  Get a String object, or jsNull() if s is null
    */
-  ValueImp *getStringOrNull(DOM::DOMString s);
+  ValueImp *jsStringOrNull(const DOM::DOMString&);
 
   /**
    *  Get a DOMString object or a null DOMString if the value is null
index bb1d2fa..6d915c3 100644 (file)
@@ -141,7 +141,7 @@ DOMCSSStyleDeclaration::~DOMCSSStyleDeclaration()
 ValueImp *DOMCSSStyleDeclaration::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
   DOMCSSStyleDeclaration *thisObj = static_cast<DOMCSSStyleDeclaration *>(slot.slotBase());
-  return getStringOrNull(thisObj->m_impl->item(slot.index()));
+  return jsStringOrNull(thisObj->m_impl->item(slot.index()));
 }
 
 ValueImp *DOMCSSStyleDeclaration::cssPropertyGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -158,11 +158,11 @@ ValueImp *DOMCSSStyleDeclaration::cssPropertyGetter(ExecState *exec, const Ident
   CSSValueImpl *v = thisObj->m_impl->getPropertyCSSValue(prop);
   if (v) {
     if (pixelOrPos && v->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE)
-      return Number(static_cast<CSSPrimitiveValueImpl *>(v)->getFloatValue(CSSPrimitiveValue::CSS_PX));
+      return jsNumber(static_cast<CSSPrimitiveValueImpl *>(v)->getFloatValue(CSSPrimitiveValue::CSS_PX));
     else
-      return getStringOrNull(v->cssText());
+      return jsStringOrNull(v->cssText());
   } else
-    return String("");
+    return jsString("");
 }
 
 bool DOMCSSStyleDeclaration::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -193,14 +193,14 @@ ValueImp *DOMCSSStyleDeclaration::getValueProperty(ExecState *exec, int token)
 {
   switch (token) {
   case CssText:
-    return getStringOrNull(m_impl->cssText());
+    return jsStringOrNull(m_impl->cssText());
   case Length:
     return jsNumber(m_impl->length());
   case ParentRule:
     return getDOMCSSRule(exec, m_impl->parentRule());
   default:
     assert(0);
-    return Undefined();
+    return jsUndefined();
   }
 }
 
@@ -252,24 +252,24 @@ ValueImp *DOMCSSStyleDeclarationProtoFunc::callAsFunction(ExecState *exec, Objec
 
   switch (id) {
     case DOMCSSStyleDeclaration::GetPropertyValue:
-      return getStringOrNull(styleDecl.getPropertyValue(s));
+      return jsStringOrNull(styleDecl.getPropertyValue(s));
     case DOMCSSStyleDeclaration::GetPropertyCSSValue:
       return getDOMCSSValue(exec,styleDecl.getPropertyCSSValue(s));
     case DOMCSSStyleDeclaration::RemoveProperty:
-      return getStringOrNull(styleDecl.removeProperty(s, exception));
+      return jsStringOrNull(styleDecl.removeProperty(s, exception));
     case DOMCSSStyleDeclaration::GetPropertyPriority:
-      return getStringOrNull(styleDecl.getPropertyPriority(s));
+      return jsStringOrNull(styleDecl.getPropertyPriority(s));
     case DOMCSSStyleDeclaration::GetPropertyShorthand:
-      return getStringOrNull(styleDecl.getPropertyShorthand(s));
+      return jsStringOrNull(styleDecl.getPropertyShorthand(s));
     case DOMCSSStyleDeclaration::IsPropertyImplicit:
-      return Boolean(styleDecl.isPropertyImplicit(s));
+      return jsBoolean(styleDecl.isPropertyImplicit(s));
     case DOMCSSStyleDeclaration::SetProperty:
       styleDecl.setProperty(s, args[1]->toString(exec).domString(), args[2]->toString(exec).domString(), exception);
-      return Undefined();
+      return jsUndefined();
     case DOMCSSStyleDeclaration::Item:
-      return getStringOrNull(styleDecl.item(args[0]->toInt32(exec)));
+      return jsStringOrNull(styleDecl.item(args[0]->toInt32(exec)));
     default:
-      return Undefined();
+      return jsUndefined();
   }
 }
 
@@ -308,17 +308,17 @@ ValueImp *DOMStyleSheet::getValueProperty(ExecState *exec, int token) const
   StyleSheetImpl &styleSheet = *m_impl;
   switch (token) {
   case Type:
-    return getStringOrNull(styleSheet.type());
+    return jsStringOrNull(styleSheet.type());
   case Disabled:
-    return Boolean(styleSheet.disabled());
+    return jsBoolean(styleSheet.disabled());
   case OwnerNode:
     return getDOMNode(exec,styleSheet.ownerNode());
   case ParentStyleSheet:
     return getDOMStyleSheet(exec,styleSheet.parentStyleSheet());
   case Href:
-    return getStringOrNull(styleSheet.href());
+    return jsStringOrNull(styleSheet.href());
   case Title:
-    return getStringOrNull(styleSheet.title());
+    return jsStringOrNull(styleSheet.title());
   case Media:
     return getDOMMediaList(exec, styleSheet.media());
   }
@@ -338,7 +338,7 @@ ValueImp *getDOMStyleSheet(ExecState *exec, StyleSheetImpl *ss)
 {
   DOMObject *ret;
   if (!ss)
-    return Null();
+    return jsNull();
   ScriptInterpreter *interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
   if ((ret = interp->getDOMObject(ss)))
     return ret;
@@ -373,10 +373,10 @@ ValueImp *DOMStyleSheetList::getValueProperty(ExecState *exec, int token) const
 {
     switch(token) {
     case Length:
-      return Number(m_impl->length());
+      return jsNumber(m_impl->length());
     default:
       assert(0);
-      return Undefined();
+      return jsUndefined();
     }
 }
 
@@ -437,7 +437,7 @@ ValueImp *getDOMStyleSheetList(ExecState *exec, StyleSheetListImpl *ssl, Documen
   // Can't use the cacheDOMObject macro because of the doc argument
   DOMObject *ret;
   if (!ssl)
-    return Null();
+    return jsNull();
   ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
   if ((ret = interp->getDOMObject(ssl)))
     return ret;
@@ -455,7 +455,7 @@ ValueImp *DOMStyleSheetListFunc::callAsFunction(ExecState *exec, ObjectImp *this
   StyleSheetListImpl &styleSheetList = *static_cast<DOMStyleSheetList *>(thisObj)->impl();
   if (id == DOMStyleSheetList::Item)
     return getDOMStyleSheet(exec, styleSheetList.item(args[0]->toInt32(exec)));
-  return Undefined();
+  return jsUndefined();
 }
 
 // -------------------------------------------------------------------------
@@ -492,19 +492,19 @@ ValueImp *DOMMediaList::getValueProperty(ExecState *exec, int token)
 {
   switch (token) {
   case MediaText:
-    return getStringOrNull(m_impl->mediaText());
+    return jsStringOrNull(m_impl->mediaText());
   case Length:
-    return Number(m_impl->length());
+    return jsNumber(m_impl->length());
   default:
     assert(0);
-    return Undefined();
+    return jsUndefined();
   }
 }
 
 ValueImp *DOMMediaList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
   DOMMediaList *thisObj = static_cast<DOMMediaList *>(slot.slotBase());
-  return getStringOrNull(thisObj->m_impl->item(slot.index()));
+  return jsStringOrNull(thisObj->m_impl->item(slot.index()));
 }
 
 bool DOMMediaList::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -546,15 +546,15 @@ ValueImp *KJS::DOMMediaListProtoFunc::callAsFunction(ExecState *exec, ObjectImp
   MediaListImpl &mediaList = *static_cast<DOMMediaList *>(thisObj)->impl();
   switch (id) {
     case DOMMediaList::Item:
-      return getStringOrNull(mediaList.item(args[0]->toInt32(exec)));
+      return jsStringOrNull(mediaList.item(args[0]->toInt32(exec)));
     case DOMMediaList::DeleteMedium:
       mediaList.deleteMedium(args[0]->toString(exec).domString());
-      return Undefined();
+      return jsUndefined();
     case DOMMediaList::AppendMedium:
       mediaList.appendMedium(args[0]->toString(exec).domString());
-      return Undefined();
+      return jsUndefined();
     default:
-      return Undefined();
+      return jsUndefined();
   }
 }
 
@@ -600,7 +600,7 @@ ValueImp *DOMCSSStyleSheet::getValueProperty(ExecState *exec, int token) const
     return getDOMCSSRuleList(exec, static_cast<CSSStyleSheetImpl *>(impl())->cssRules());
   default:
     assert(0);
-    return Undefined();
+    return jsUndefined();
   }
 }
 
@@ -617,18 +617,18 @@ ValueImp *DOMCSSStyleSheetProtoFunc::callAsFunction(ExecState *exec, ObjectImp *
   CSSStyleSheetImpl &styleSheet = *static_cast<CSSStyleSheetImpl *>(static_cast<DOMCSSStyleSheet *>(thisObj)->impl());
   switch (id) {
     case DOMCSSStyleSheet::InsertRule:
-      return Number(styleSheet.insertRule(args[0]->toString(exec).domString(), args[1]->toInt32(exec), exception));
+      return jsNumber(styleSheet.insertRule(args[0]->toString(exec).domString(), args[1]->toInt32(exec), exception));
     case DOMCSSStyleSheet::DeleteRule:
       styleSheet.deleteRule(args[0]->toInt32(exec), exception);
-      return Undefined();
+      return jsUndefined();
     case DOMCSSStyleSheet::AddRule: {
       int index = args.size() >= 3 ? args[2]->toInt32(exec) : -1;
       styleSheet.addRule(args[0]->toString(exec).domString(), args[1]->toString(exec).domString(), index, exception);
       // As per Microsoft documentation, always return -1.
-      return Number(-1);
+      return jsNumber(-1);
     }
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 // -------------------------------------------------------------------------
@@ -651,10 +651,10 @@ ValueImp *DOMCSSRuleList::getValueProperty(ExecState *exec, int token) const
 {
   switch (token) {
   case Length:
-    return Number(m_impl->length());
+    return jsNumber(m_impl->length());
   default:
     assert(0);
-    return Undefined();
+    return jsUndefined();
   }
 }
 
@@ -697,7 +697,7 @@ ValueImp *DOMCSSRuleListFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj
     case DOMCSSRuleList::Item:
       return getDOMCSSRule(exec,cssRuleList.item(args[0]->toInt32(exec)));
     default:
-      return Undefined();
+      return jsUndefined();
   }
 }
 
@@ -795,9 +795,9 @@ ValueImp *DOMCSSRule::getValueProperty(ExecState *exec, int token) const
   CSSRuleImpl &cssRule = *m_impl;
   switch (token) {
   case Type:
-    return Number(cssRule.type());
+    return jsNumber(cssRule.type());
   case CssText:
-    return getStringOrNull(cssRule.cssText());
+    return jsStringOrNull(cssRule.cssText());
   case ParentStyleSheet:
     return getDOMStyleSheet(exec,cssRule.parentStyleSheet());
   case ParentRule:
@@ -805,7 +805,7 @@ ValueImp *DOMCSSRule::getValueProperty(ExecState *exec, int token) const
 
   // for DOM::CSSRule::STYLE_RULE:
   case Style_SelectorText:
-    return getStringOrNull(static_cast<CSSStyleRuleImpl *>(m_impl.get())->selectorText());
+    return jsStringOrNull(static_cast<CSSStyleRuleImpl *>(m_impl.get())->selectorText());
   case Style_Style:
     return getDOMCSSStyleDeclaration(exec, static_cast<CSSStyleRuleImpl *>(m_impl.get())->style());
 
@@ -821,13 +821,13 @@ ValueImp *DOMCSSRule::getValueProperty(ExecState *exec, int token) const
 
   // for DOM::CSSRule::PAGE_RULE:
   case Page_SelectorText:
-    return getStringOrNull(static_cast<CSSPageRuleImpl *>(m_impl.get())->selectorText());
+    return jsStringOrNull(static_cast<CSSPageRuleImpl *>(m_impl.get())->selectorText());
   case Page_Style:
     return getDOMCSSStyleDeclaration(exec, static_cast<CSSPageRuleImpl *>(m_impl.get())->style());
 
   // for DOM::CSSRule::IMPORT_RULE:
   case Import_Href:
-    return getStringOrNull(static_cast<CSSImportRuleImpl *>(m_impl.get())->href());
+    return jsStringOrNull(static_cast<CSSImportRuleImpl *>(m_impl.get())->href());
   case Import_Media:
     return getDOMMediaList(exec, static_cast<CSSImportRuleImpl *>(m_impl.get())->media());
   case Import_StyleSheet:
@@ -835,12 +835,12 @@ ValueImp *DOMCSSRule::getValueProperty(ExecState *exec, int token) const
 
   // for DOM::CSSRule::CHARSET_RULE:
   case Charset_Encoding:
-    return getStringOrNull(static_cast<CSSCharsetRuleImpl *>(m_impl.get())->encoding());
+    return jsStringOrNull(static_cast<CSSCharsetRuleImpl *>(m_impl.get())->encoding());
 
   default:
     assert(0);
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 void DOMCSSRule::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
@@ -894,12 +894,12 @@ ValueImp *DOMCSSRuleFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, co
   if (cssRule.type() == DOM::CSSRule::MEDIA_RULE) {
     CSSMediaRuleImpl &rule = static_cast<CSSMediaRuleImpl &>(cssRule);
     if (id == DOMCSSRule::Media_InsertRule)
-      return Number(rule.insertRule(args[0]->toString(exec).domString(), args[1]->toInt32(exec)));
+      return jsNumber(rule.insertRule(args[0]->toString(exec).domString(), args[1]->toInt32(exec)));
     else if (id == DOMCSSRule::Media_DeleteRule)
       rule.deleteRule(args[0]->toInt32(exec));
   }
 
-  return Undefined();
+  return jsUndefined();
 }
 
 ValueImp *getDOMCSSRule(ExecState *exec, CSSRuleImpl *r)
@@ -931,19 +931,19 @@ ValueImp *CSSRuleConstructor::getValueProperty(ExecState *, int token) const
 {
   switch (token) {
   case UNKNOWN_RULE:
-    return Number(DOM::CSSRule::UNKNOWN_RULE);
+    return jsNumber(DOM::CSSRule::UNKNOWN_RULE);
   case STYLE_RULE:
-    return Number(DOM::CSSRule::STYLE_RULE);
+    return jsNumber(DOM::CSSRule::STYLE_RULE);
   case CHARSET_RULE:
-    return Number(DOM::CSSRule::CHARSET_RULE);
+    return jsNumber(DOM::CSSRule::CHARSET_RULE);
   case IMPORT_RULE:
-    return Number(DOM::CSSRule::IMPORT_RULE);
+    return jsNumber(DOM::CSSRule::IMPORT_RULE);
   case MEDIA_RULE:
-    return Number(DOM::CSSRule::MEDIA_RULE);
+    return jsNumber(DOM::CSSRule::MEDIA_RULE);
   case FONT_FACE_RULE:
-    return Number(DOM::CSSRule::FONT_FACE_RULE);
+    return jsNumber(DOM::CSSRule::FONT_FACE_RULE);
   case PAGE_RULE:
-    return Number(DOM::CSSRule::PAGE_RULE);
+    return jsNumber(DOM::CSSRule::PAGE_RULE);
   }
   return NULL;
 }
@@ -973,12 +973,12 @@ ValueImp *DOMCSSValue::getValueProperty(ExecState *exec, int token) const
   CSSValueImpl &cssValue = *m_impl;
   switch (token) {
   case CssText:
-    return getStringOrNull(cssValue.cssText());
+    return jsStringOrNull(cssValue.cssText());
   case CssValueType:
-    return Number(cssValue.cssValueType());
+    return jsNumber(cssValue.cssValueType());
   default:
     assert(0);
-    return Undefined();
+    return jsUndefined();
   }
 }
 
@@ -1000,7 +1000,7 @@ ValueImp *getDOMCSSValue(ExecState *exec, CSSValueImpl *v)
 {
   DOMObject *ret;
   if (!v)
-    return Null();
+    return jsNull();
   ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
   if ((ret = interp->getDOMObject(v)))
     return ret;
@@ -1036,13 +1036,13 @@ ValueImp *CSSValueConstructor::getValueProperty(ExecState *, int token) const
 {
   switch (token) {
   case CSS_INHERIT:
-    return Number(DOM::CSSValue::CSS_INHERIT);
+    return jsNumber(DOM::CSSValue::CSS_INHERIT);
   case CSS_PRIMITIVE_VALUE:
-    return Number(DOM::CSSValue::CSS_PRIMITIVE_VALUE);
+    return jsNumber(DOM::CSSValue::CSS_PRIMITIVE_VALUE);
   case CSS_VALUE_LIST:
-    return Number(DOM::CSSValue::CSS_VALUE_LIST);
+    return jsNumber(DOM::CSSValue::CSS_VALUE_LIST);
   case CSS_CUSTOM:
-    return Number(DOM::CSSValue::CSS_CUSTOM);
+    return jsNumber(DOM::CSSValue::CSS_CUSTOM);
   }
   return NULL;
 }
@@ -1082,7 +1082,7 @@ DOMCSSPrimitiveValue::DOMCSSPrimitiveValue(ExecState *exec, CSSPrimitiveValueImp
 ValueImp *DOMCSSPrimitiveValue::getValueProperty(ExecState *exec, int token)
 {
   assert(token == PrimitiveType);
-  return Number(static_cast<CSSPrimitiveValueImpl *>(impl())->primitiveType());
+  return jsNumber(static_cast<CSSPrimitiveValueImpl *>(impl())->primitiveType());
 }
 
 bool DOMCSSPrimitiveValue::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -1099,14 +1099,14 @@ ValueImp *DOMCSSPrimitiveValueProtoFunc::callAsFunction(ExecState *exec, ObjectI
   switch (id) {
     case DOMCSSPrimitiveValue::SetFloatValue:
       val.setFloatValue(args[0]->toInt32(exec), args[1]->toNumber(exec), exception);
-      return Undefined();
+      return jsUndefined();
     case DOMCSSPrimitiveValue::GetFloatValue:
-      return Number(val.getFloatValue(args[0]->toInt32(exec)));
+      return jsNumber(val.getFloatValue(args[0]->toInt32(exec)));
     case DOMCSSPrimitiveValue::SetStringValue:
       val.setStringValue(args[0]->toInt32(exec), args[1]->toString(exec).domString(), exception);
-      return Undefined();
+      return jsUndefined();
     case DOMCSSPrimitiveValue::GetStringValue:
-      return getStringOrNull(val.getStringValue());
+      return jsStringOrNull(val.getStringValue());
     case DOMCSSPrimitiveValue::GetCounterValue:
       return getDOMCounter(exec,val.getCounterValue());
     case DOMCSSPrimitiveValue::GetRectValue:
@@ -1114,7 +1114,7 @@ ValueImp *DOMCSSPrimitiveValueProtoFunc::callAsFunction(ExecState *exec, ObjectI
     case DOMCSSPrimitiveValue::GetRGBColorValue:
       return getDOMRGBColor(exec,val.getRGBColorValue());
     default:
-      return Undefined();
+      return jsUndefined();
   }
 }
 
@@ -1161,7 +1161,7 @@ bool CSSPrimitiveValueConstructor::getOwnPropertySlot(ExecState *exec, const Ide
 ValueImp *CSSPrimitiveValueConstructor::getValueProperty(ExecState *, int token) const
 {
   // We use the token as the value to return directly
-  return Number(token);
+  return jsNumber(token);
 }
 
 ValueImp *getCSSPrimitiveValueConstructor(ExecState *exec)
@@ -1189,7 +1189,7 @@ DOMCSSValueList::DOMCSSValueList(ExecState *exec, CSSValueListImpl *v)
 ValueImp *DOMCSSValueList::getValueProperty(ExecState *exec, int token) const
 {
   assert(token == Length);
-  return Number(static_cast<CSSValueListImpl *>(impl())->length());
+  return jsNumber(static_cast<CSSValueListImpl *>(impl())->length());
 }
 
 ValueImp *DOMCSSValueList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -1228,7 +1228,7 @@ ValueImp *DOMCSSValueListFunc::callAsFunction(ExecState *exec, ObjectImp *thisOb
     case DOMCSSValueList::Item:
       return getDOMCSSValue(exec,valueList.item(args[0]->toInt32(exec)));
     default:
-      return Undefined();
+      return jsUndefined();
   }
 }
 
@@ -1345,11 +1345,11 @@ ValueImp *DOMCounter::getValueProperty(ExecState *, int token) const
   CounterImpl &counter = *m_counter;
   switch (token) {
   case identifier:
-    return getStringOrNull(counter.identifier());
+    return jsStringOrNull(counter.identifier());
   case listStyle:
-    return getStringOrNull(counter.listStyle());
+    return jsStringOrNull(counter.listStyle());
   case separator:
-    return getStringOrNull(counter.separator());
+    return jsStringOrNull(counter.separator());
   default:
     return NULL;
   }
index 643d246..63acbf7 100644 (file)
@@ -280,11 +280,11 @@ ValueImp *DOMNode::getValueProperty(ExecState *exec, int token) const
   NodeImpl &node = *m_impl;
   switch (token) {
   case NodeName:
-    return getStringOrNull(node.nodeName());
+    return jsStringOrNull(node.nodeName());
   case NodeValue:
-    return getStringOrNull(node.nodeValue());
+    return jsStringOrNull(node.nodeValue());
   case NodeType:
-    return Number(node.nodeType());
+    return jsNumber(node.nodeType());
   case ParentNode:
   case ParentElement: // IE only apparently
     return getDOMNode(exec,node.parentNode());
@@ -301,15 +301,15 @@ ValueImp *DOMNode::getValueProperty(ExecState *exec, int token) const
   case Attributes:
     return getDOMNamedNodeMap(exec,node.attributes());
   case NamespaceURI:
-    return getStringOrNull(node.namespaceURI());
+    return jsStringOrNull(node.namespaceURI());
   case Prefix:
-    return getStringOrNull(node.prefix());
+    return jsStringOrNull(node.prefix());
   case LocalName:
-    return getStringOrNull(node.localName());
+    return jsStringOrNull(node.localName());
   case OwnerDocument:
     return getDOMNode(exec,node.ownerDocument());
   case TextContent:
-    return getStringOrNull(node.textContent());
+    return jsStringOrNull(node.textContent());
   case OnAbort:
     return getListener(abortEvent);
   case OnBlur:
@@ -427,9 +427,9 @@ ValueImp *DOMNode::getValueProperty(ExecState *exec, int token) const
     case ScrollHeight:
         return rend ? jsNumber(rend->scrollHeight()) : static_cast<ValueImp *>(jsUndefined());
     case ScrollLeft:
-      return Number(rend && rend->layer() ? rend->layer()->scrollXOffset() : 0);
+      return jsNumber(rend && rend->layer() ? rend->layer()->scrollXOffset() : 0);
     case ScrollTop:
-      return Number(rend && rend->layer() ? rend->layer()->scrollYOffset() : 0);
+      return jsNumber(rend && rend->layer() ? rend->layer()->scrollYOffset() : 0);
     default:
       kdWarning() << "Unhandled token in DOMNode::getValueProperty : " << token << endl;
       break;
@@ -608,9 +608,9 @@ void DOMNode::putValueProperty(ExecState *exec, int token, ValueImp *value, int
 ValueImp *DOMNode::toPrimitive(ExecState *exec, Type /*preferred*/) const
 {
   if (!m_impl)
-    return Null();
+    return jsNull();
 
-  return String(toString(exec));
+  return jsString(toString(exec));
 }
 
 UString DOMNode::toString(ExecState *) const
@@ -632,7 +632,7 @@ ValueImp *DOMNode::getListener(const AtomicString &eventType) const
     if ( jsListener && jsListener->listenerObjImp() )
        return jsListener->listenerObj();
     else
-       return Null();
+       return jsNull();
 }
 
 void DOMNode::pushEventHandlerScope(ExecState *, ScopeChain &) const
@@ -647,41 +647,41 @@ ValueImp *DOMNodeProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj,
   NodeImpl &node = *static_cast<DOMNode *>(thisObj)->impl();
   switch (id) {
     case DOMNode::HasAttributes:
-      return Boolean(node.hasAttributes());
+      return jsBoolean(node.hasAttributes());
     case DOMNode::HasChildNodes:
-      return Boolean(node.hasChildNodes());
+      return jsBoolean(node.hasChildNodes());
     case DOMNode::CloneNode:
       return getDOMNode(exec,node.cloneNode(args[0]->toBoolean(exec)));
     case DOMNode::Normalize:
       node.normalize();
-      return Undefined();
+      return jsUndefined();
     case DOMNode::IsSupported:
-        return Boolean(node.isSupported(args[0]->toString(exec).domString(),
+        return jsBoolean(node.isSupported(args[0]->toString(exec).domString(),
             args[1]->isUndefinedOrNull() ? DOMString() : args[1]->toString(exec).domString()));
     case DOMNode::IsSameNode:
-        return Boolean(node.isSameNode(toNode(args[0])));
+        return jsBoolean(node.isSameNode(toNode(args[0])));
     case DOMNode::IsEqualNode:
-        return Boolean(node.isEqualNode(toNode(args[0])));
+        return jsBoolean(node.isEqualNode(toNode(args[0])));
     case DOMNode::IsDefaultNamespace:
-        return Boolean(node.isDefaultNamespace(valueToStringWithNullCheck(exec, args[0])));
+        return jsBoolean(node.isDefaultNamespace(valueToStringWithNullCheck(exec, args[0])));
     case DOMNode::LookupNamespaceURI:
-        return getStringOrNull(node.lookupNamespaceURI(valueToStringWithNullCheck(exec, args[0])));
+        return jsStringOrNull(node.lookupNamespaceURI(valueToStringWithNullCheck(exec, args[0])));
     case DOMNode::LookupPrefix:
-        return getStringOrNull(node.lookupPrefix(valueToStringWithNullCheck(exec, args[0])));
+        return jsStringOrNull(node.lookupPrefix(valueToStringWithNullCheck(exec, args[0])));
     case DOMNode::AddEventListener: {
         JSEventListener *listener = Window::retrieveActive(exec)->getJSEventListener(args[1]);
         if (listener)
             node.addEventListener(AtomicString(args[0]->toString(exec).domString()), listener,args[2]->toBoolean(exec));
-        return Undefined();
+        return jsUndefined();
     }
     case DOMNode::RemoveEventListener: {
         JSEventListener *listener = Window::retrieveActive(exec)->getJSEventListener(args[1]);
         if (listener)
             node.removeEventListener(AtomicString(args[0]->toString(exec).domString()), listener,args[2]->toBoolean(exec));
-        return Undefined();
+        return jsUndefined();
     }
     case DOMNode::DispatchEvent:
-      return Boolean(node.dispatchEvent(toEvent(args[0]), exception));
+      return jsBoolean(node.dispatchEvent(toEvent(args[0]), exception));
     case DOMNode::AppendChild:
       return getDOMNode(exec,node.appendChild(toNode(args[0]), exception));
     case DOMNode::RemoveChild:
@@ -693,15 +693,15 @@ ValueImp *DOMNodeProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj,
     case DOMNode::Contains:
       if (node.isElementNode())
         if (NodeImpl *node0 = toNode(args[0]))
-          return Boolean(node.isAncestor(node0));
+          return jsBoolean(node.isAncestor(node0));
       // FIXME: Is there a good reason to return undefined rather than false
       // when the parameter is not a node? When the object is not an element?
-      return Undefined();
+      return jsUndefined();
     case DOMNode::Item:
       return thisObj->get(exec, args[0]->toInt32(exec));
   }
 
-  return Undefined();
+  return jsUndefined();
 }
 
 NodeImpl *toNode(ValueImp *val)
@@ -732,15 +732,15 @@ DOMNodeList::~DOMNodeList()
 ValueImp *DOMNodeList::toPrimitive(ExecState *exec, Type /*preferred*/) const
 {
   if (!m_impl)
-    return Null();
+    return jsNull();
 
-  return String(toString(exec));
+  return jsString(toString(exec));
 }
 
 ValueImp *DOMNodeList::getValueProperty(ExecState *exec, int token) const
 {
   assert(token == Length);
-  return Number(m_impl->length());
+  return jsNumber(m_impl->length());
 }
 
 ValueImp *DOMNodeList::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -793,7 +793,7 @@ ValueImp *DOMNodeList::callAsFunction(ExecState *exec, ObjectImp *, const List &
   if (ok)
     return getDOMNode(exec, m_impl->item(u));
 
-  return Undefined();
+  return jsUndefined();
 }
 
 // Not a prototype class currently, but should probably be converted to one
@@ -837,11 +837,11 @@ ValueImp *DOMAttr::getValueProperty(ExecState *exec, int token) const
   AttrImpl *attr = static_cast<AttrImpl *>(impl());
   switch (token) {
   case Name:
-    return getStringOrNull(attr->name());
+    return jsStringOrNull(attr->name());
   case Specified:
-    return Boolean(attr->specified());
+    return jsBoolean(attr->specified());
   case ValueProperty:
-    return getStringOrNull(attr->value());
+    return jsStringOrNull(attr->value());
   case OwnerElement: // DOM2
     return getDOMNode(exec, attr->ownerElement());
   }
@@ -970,28 +970,28 @@ ValueImp *DOMDocument::getValueProperty(ExecState *exec, int token) const
   case ActualEncoding:
   case InputEncoding:
     if (Decoder* decoder = doc.decoder())
-      return String(decoder->encoding());
-    return Null();
+      return jsString(decoder->encoding());
+    return jsNull();
   case DefaultCharset:
     if (KHTMLPart* part = doc.part())
-        return String(part->settings()->encoding());
-    return Undefined();
+        return jsString(part->settings()->encoding());
+    return jsUndefined();
   case StyleSheets:
     //kdDebug() << "DOMDocument::StyleSheets, returning " << doc.styleSheets().length() << " stylesheets" << endl;
     return getDOMStyleSheetList(exec, doc.styleSheets(), &doc);
   case PreferredStylesheetSet:
-    return getStringOrNull(doc.preferredStylesheetSet());
+    return jsStringOrNull(doc.preferredStylesheetSet());
   case SelectedStylesheetSet:
-    return getStringOrNull(doc.selectedStylesheetSet());
+    return jsStringOrNull(doc.selectedStylesheetSet());
   case ReadyState:
     if (KHTMLPart* part = doc.part()) {
-      if (part->d->m_bComplete) return String("complete");
-      if (doc.parsing()) return String("loading");
-      return String("loaded");
+      if (part->d->m_bComplete) return jsString("complete");
+      if (doc.parsing()) return jsString("loading");
+      return jsString("loaded");
       // What does the interactive value mean ?
       // Missing support for "uninitialized"
     }
-    return Undefined();
+    return jsUndefined();
   case DOMDocument::DefaultView: // DOM2
     return getDOMAbstractView(exec,doc.defaultView());
   default:
@@ -1092,21 +1092,21 @@ ValueImp *DOMDocumentProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisO
     if (ElementImpl *element0 = toElement(args[0]))
         return getDOMCSSStyleDeclaration(exec,doc.getOverrideStyle(element0, args[1]->toString(exec).domString()));
     // FIXME: Is undefined right here, or should we raise an exception?
-    return Undefined();
+    return jsUndefined();
   case DOMDocument::ExecCommand: {
-    return Boolean(doc.execCommand(args[0]->toString(exec).domString(), args[1]->toBoolean(exec), args[2]->toString(exec).domString()));
+    return jsBoolean(doc.execCommand(args[0]->toString(exec).domString(), args[1]->toBoolean(exec), args[2]->toString(exec).domString()));
   }
   case DOMDocument::QueryCommandEnabled: {
-    return Boolean(doc.queryCommandEnabled(args[0]->toString(exec).domString()));
+    return jsBoolean(doc.queryCommandEnabled(args[0]->toString(exec).domString()));
   }
   case DOMDocument::QueryCommandIndeterm: {
-    return Boolean(doc.queryCommandIndeterm(args[0]->toString(exec).domString()));
+    return jsBoolean(doc.queryCommandIndeterm(args[0]->toString(exec).domString()));
   }
   case DOMDocument::QueryCommandState: {
-    return Boolean(doc.queryCommandState(args[0]->toString(exec).domString()));
+    return jsBoolean(doc.queryCommandState(args[0]->toString(exec).domString()));
   }
   case DOMDocument::QueryCommandSupported: {
-    return Boolean(doc.queryCommandSupported(args[0]->toString(exec).domString()));
+    return jsBoolean(doc.queryCommandSupported(args[0]->toString(exec).domString()));
   }
   case DOMDocument::QueryCommandValue: {
     DOM::DOMString commandValue(doc.queryCommandValue(args[0]->toString(exec).domString()));
@@ -1114,15 +1114,15 @@ ValueImp *DOMDocumentProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisO
     // Microsoft documentation for this method says:
     // "If not supported [for a command identifier], this method returns a Boolean set to false."
     if (commandValue.isNull())
-        return Boolean(false);
+        return jsBoolean(false);
     else 
-        return String(commandValue);
+        return jsString(commandValue);
   }
   default:
     break;
   }
 
-  return Undefined();
+  return jsUndefined();
 }
 
 // -------------------------------------------------------------------------
@@ -1181,12 +1181,12 @@ ValueImp *DOMElement::getValueProperty(ExecState *exec, int token) const
   ElementImpl *element = static_cast<ElementImpl *>(impl());
   switch (token) {
   case TagName:
-    return getStringOrNull(element->nodeName());
+    return jsStringOrNull(element->nodeName());
   case Style:
     return getDOMCSSStyleDeclaration(exec, element->style());
   default:
     assert(0);
-    return Undefined();
+    return jsUndefined();
   }
 }
 
@@ -1196,7 +1196,7 @@ ValueImp *DOMElement::attributeGetter(ExecState *exec, const Identifier& propert
 
   ElementImpl *element = static_cast<ElementImpl *>(thisObj->impl());
   DOM::DOMString attr = element->getAttribute(propertyName.domString());
-  return getStringOrNull(attr);
+  return jsStringOrNull(attr);
 }
 
 bool DOMElement::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -1240,15 +1240,15 @@ ValueImp *DOMElementProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisOb
 
   switch(id) {
     case DOMElement::GetAttribute:
-      // getStringOrNull should be used here, since if the attribute isn't present at all, you should
+      // jsStringOrNull should be used here, since if the attribute isn't present at all, you should
       // return null and not "".
-      return getStringOrNull(element.getAttribute(args[0]->toString(exec).domString()));
+      return jsStringOrNull(element.getAttribute(args[0]->toString(exec).domString()));
     case DOMElement::SetAttribute:
       element.setAttribute(args[0]->toString(exec).domString(), args[1]->toString(exec).domString(), exception);
-      return Undefined();
+      return jsUndefined();
     case DOMElement::RemoveAttribute:
       element.removeAttribute(args[0]->toString(exec).domString(), exception);
-      return Undefined();
+      return jsUndefined();
     case DOMElement::GetAttributeNode:
       return getDOMNode(exec,element.getAttributeNode(args[0]->toString(exec).domString()));
     case DOMElement::SetAttributeNode:
@@ -1258,15 +1258,15 @@ ValueImp *DOMElementProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisOb
     case DOMElement::GetElementsByTagName:
       return getDOMNodeList(exec, element.getElementsByTagName(args[0]->toString(exec).domString()).get());
     case DOMElement::HasAttribute: // DOM2
-      return Boolean(element.hasAttribute(args[0]->toString(exec).domString()));
+      return jsBoolean(element.hasAttribute(args[0]->toString(exec).domString()));
     case DOMElement::GetAttributeNS: // DOM2
-      return String(element.getAttributeNS(args[0]->toString(exec).domString(),args[1]->toString(exec).domString()).domString());
+      return jsString(element.getAttributeNS(args[0]->toString(exec).domString(),args[1]->toString(exec).domString()).domString());
     case DOMElement::SetAttributeNS: // DOM2
       element.setAttributeNS(valueToStringWithNullCheck(exec, args[0]), args[1]->toString(exec).domString(), args[2]->toString(exec).domString(), exception);
-      return Undefined();
+      return jsUndefined();
     case DOMElement::RemoveAttributeNS: // DOM2
       element.removeAttributeNS(args[0]->toString(exec).domString(), args[1]->toString(exec).domString(), exception);
-      return Undefined();
+      return jsUndefined();
     case DOMElement::GetAttributeNodeNS: // DOM2
       return getDOMNode(exec,element.getAttributeNodeNS(args[0]->toString(exec).domString(),args[1]->toString(exec).domString()));
     case DOMElement::SetAttributeNodeNS: // DOM2
@@ -1274,10 +1274,10 @@ ValueImp *DOMElementProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisOb
     case DOMElement::GetElementsByTagNameNS: // DOM2
       return getDOMNodeList(exec, element.getElementsByTagNameNS(args[0]->toString(exec).domString(), args[1]->toString(exec).domString()).get());
     case DOMElement::HasAttributeNS: // DOM2
-      return Boolean(element.hasAttributeNS(args[0]->toString(exec).domString(),args[1]->toString(exec).domString()));
+      return jsBoolean(element.hasAttributeNS(args[0]->toString(exec).domString(),args[1]->toString(exec).domString()));
     case DOMElement::ScrollIntoView: 
         element.scrollIntoView(args[0]->isUndefinedOrNull() || args[0]->toBoolean(exec));
-        return Undefined();
+        return jsUndefined();
     case DOMElement::ScrollByLines:
     case DOMElement::ScrollByPages:
       if (DocumentImpl* doc = element.getDocument()) {
@@ -1294,15 +1294,15 @@ ValueImp *DOMElementProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisOb
             rend->layer()->scroll(direction, granularity, multiplier);
           }
       }
-      return Undefined();
+      return jsUndefined();
     case DOMElement::ElementFocus:
         element.focus();
-        return Undefined();
+        return jsUndefined();
     case DOMElement::ElementBlur:
         element.blur();
-        return Undefined();
+        return jsUndefined();
     default:
-      return Undefined();
+      return jsUndefined();
     }
 }
 
@@ -1351,7 +1351,7 @@ ValueImp *DOMDOMImplementationProtoFunc::callAsFunction(ExecState *exec, ObjectI
 
   switch(id) {
   case DOMDOMImplementation::HasFeature:
-    return Boolean(implementation.hasFeature(args[0]->toString(exec).domString(),
+    return jsBoolean(implementation.hasFeature(args[0]->toString(exec).domString(),
         args[1]->isUndefinedOrNull() ? DOMString() : args[1]->toString(exec).domString()));
   case DOMDOMImplementation::CreateDocumentType: // DOM2
     return getDOMNode(exec, implementation.createDocumentType(args[0]->toString(exec).domString(),
@@ -1366,7 +1366,7 @@ ValueImp *DOMDOMImplementationProtoFunc::callAsFunction(ExecState *exec, ObjectI
   default:
     break;
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 // -------------------------------------------------------------------------
@@ -1397,17 +1397,17 @@ ValueImp *DOMDocumentType::getValueProperty(ExecState *exec, int token) const
   DocumentTypeImpl &type = *static_cast<DocumentTypeImpl *>(impl());
   switch (token) {
   case Name:
-    return getStringOrNull(type.name());
+    return jsStringOrNull(type.name());
   case Entities:
     return getDOMNamedNodeMap(exec,type.entities());
   case Notations:
     return getDOMNamedNodeMap(exec,type.notations());
   case PublicId: // DOM2
-    return getStringOrNull(type.publicId());
+    return jsStringOrNull(type.publicId());
   case SystemId: // DOM2
-    return getStringOrNull(type.systemId());
+    return jsStringOrNull(type.systemId());
   case InternalSubset: // DOM2
-    return getStringOrNull(type.internalSubset());
+    return jsStringOrNull(type.internalSubset());
   default:
     kdWarning() << "DOMDocumentType::getValueProperty unhandled token " << token << endl;
     return NULL;
@@ -1455,7 +1455,7 @@ DOMNamedNodeMap::~DOMNamedNodeMap()
 ValueImp *DOMNamedNodeMap::lengthGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
 {
   DOMNamedNodeMap *thisObj = static_cast<DOMNamedNodeMap *>(slot.slotBase());
-  return Number(thisObj->m_impl->length());
+  return jsNumber(thisObj->m_impl->length());
 }
 
 ValueImp *DOMNamedNodeMap::indexGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -1524,7 +1524,7 @@ ValueImp *DOMNamedNodeMapProtoFunc::callAsFunction(ExecState *exec, ObjectImp *t
       break;
   }
 
-  return Undefined();
+  return jsUndefined();
 }
 
 // -------------------------------------------------------------------------
@@ -1554,9 +1554,9 @@ ValueImp *DOMProcessingInstruction::getValueProperty(ExecState *exec, int token)
   ProcessingInstructionImpl *pi = static_cast<ProcessingInstructionImpl *>(impl());
   switch (token) {
   case Target:
-    return getStringOrNull(pi->target());
+    return jsStringOrNull(pi->target());
   case Data:
-    return getStringOrNull(pi->data());
+    return jsStringOrNull(pi->data());
   case Sheet:
     return getDOMStyleSheet(exec,pi->sheet());
   default:
@@ -1601,9 +1601,9 @@ ValueImp *DOMNotation::getValueProperty(ExecState *, int token) const
 {
   switch (token) {
   case PublicId:
-    return getStringOrNull(static_cast<NotationImpl *>(impl())->publicId());
+    return jsStringOrNull(static_cast<NotationImpl *>(impl())->publicId());
   case SystemId:
-    return getStringOrNull(static_cast<NotationImpl *>(impl())->systemId());
+    return jsStringOrNull(static_cast<NotationImpl *>(impl())->systemId());
   default:
     kdWarning() << "DOMNotation::getValueProperty unhandled token " << token << endl;
     return NULL;
@@ -1636,11 +1636,11 @@ ValueImp *DOMEntity::getValueProperty(ExecState *, int token) const
 {
   switch (token) {
   case PublicId:
-    return getStringOrNull(static_cast<EntityImpl *>(impl())->publicId());
+    return jsStringOrNull(static_cast<EntityImpl *>(impl())->publicId());
   case SystemId:
-    return getStringOrNull(static_cast<EntityImpl *>(impl())->systemId());
+    return jsStringOrNull(static_cast<EntityImpl *>(impl())->systemId());
   case NotationName:
-    return getStringOrNull(static_cast<EntityImpl *>(impl())->notationName());
+    return jsStringOrNull(static_cast<EntityImpl *>(impl())->notationName());
   default:
     kdWarning() << "DOMEntity::getValueProperty unhandled token " << token << endl;
     return NULL;
@@ -1689,7 +1689,7 @@ ValueImp *getDOMNode(ExecState *exec, NodeImpl *n)
 {
   DOMNode *ret = 0;
   if (!n)
-    return Null();
+    return jsNull();
   ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
   DocumentImpl *doc = n->getDocument();
 
@@ -1807,7 +1807,7 @@ bool NodeConstructor::getOwnPropertySlot(ExecState *exec, const Identifier& prop
 ValueImp *NodeConstructor::getValueProperty(ExecState *, int token) const
 {
   // We use the token as the value to return directly
-  return Number((unsigned int)token);
+  return jsNumber(token);
 }
 
 ObjectImp *getNodeConstructor(ExecState *exec)
@@ -1847,7 +1847,7 @@ bool DOMExceptionConstructor::getOwnPropertySlot(ExecState *exec, const Identifi
 ValueImp *DOMExceptionConstructor::getValueProperty(ExecState *, int token) const
 {
   // We use the token as the value to return directly
-  return Number((unsigned int)token);
+  return jsNumber(token);
 }
 
 ObjectImp *getDOMExceptionConstructor(ExecState *exec)
@@ -1868,7 +1868,7 @@ DOMNamedNodesCollection::DOMNamedNodesCollection(ExecState *, const QValueList<
 ValueImp *DOMNamedNodesCollection::lengthGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
 {
   DOMNamedNodesCollection *thisObj = static_cast<DOMNamedNodesCollection *>(slot.slotBase());
-  return Number(thisObj->m_nodes.count());
+  return jsNumber(thisObj->m_nodes.count());
 }
 
 ValueImp *DOMNamedNodesCollection::indexGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -1951,9 +1951,9 @@ ValueImp *DOMCharacterData::getValueProperty(ExecState *, int token) const
   CharacterDataImpl &data = *static_cast<CharacterDataImpl *>(impl());
   switch (token) {
   case Data:
-    return String(data.data());
+    return jsString(data.data());
   case Length:
-    return Number(data.length());
+    return jsNumber(data.length());
   default:
     kdWarning() << "Unhandled token in DOMCharacterData::getValueProperty : " << token << endl;
     return NULL;
@@ -1981,21 +1981,21 @@ ValueImp *DOMCharacterDataProtoFunc::callAsFunction(ExecState *exec, ObjectImp *
       if (count < 0)
         setDOMException(exec, DOMException::INDEX_SIZE_ERR);
       else
-        return getStringOrNull(data.substringData(args[0]->toInt32(exec), count, exception));
+        return jsStringOrNull(data.substringData(args[0]->toInt32(exec), count, exception));
     }
     case DOMCharacterData::AppendData:
       data.appendData(args[0]->toString(exec).domString(), exception);
-      return Undefined();
+      return jsUndefined();
     case DOMCharacterData::InsertData:
       data.insertData(args[0]->toInt32(exec), args[1]->toString(exec).domString(), exception);
-      return Undefined();
+      return jsUndefined();
     case DOMCharacterData::DeleteData: {
       const int count = args[1]->toInt32(exec);
       if (count < 0)
         setDOMException(exec, DOMException::INDEX_SIZE_ERR);
       else
         data.deleteData(args[0]->toInt32(exec), count, exception);
-      return Undefined();
+      return jsUndefined();
     }
     case DOMCharacterData::ReplaceData: {
       const int count = args[1]->toInt32(exec);
@@ -2003,10 +2003,10 @@ ValueImp *DOMCharacterDataProtoFunc::callAsFunction(ExecState *exec, ObjectImp *
         setDOMException(exec, DOMException::INDEX_SIZE_ERR);
       else
         data.replaceData(args[0]->toInt32(exec), count, args[2]->toString(exec).domString(), exception);
-      return Undefined();
+      return jsUndefined();
     }
     default:
-      return Undefined();
+      return jsUndefined();
   }
 }
 
@@ -2039,7 +2039,7 @@ ValueImp *DOMTextProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj,
     case DOMText::SplitText:
       return getDOMNode(exec, text.splitText(args[0]->toInt32(exec), exception));
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 } // namespace
index 3939395..5f145fd 100644 (file)
@@ -300,10 +300,10 @@ void JSLazyEventListener::parseCode() const
       ObjectImp *constr = interpreter->builtinFunction();
       List args;
 
-      static ProtectedPtr<ValueImp> eventString = String("event");
+      static ProtectedPtr<ValueImp> eventString = jsString("event");
       UString sourceURL(part->m_url.url());
       args.append(eventString);
-      args.append(String(code));
+      args.append(jsString(code));
       listener = constr->construct(exec, args, sourceURL, lineNumber); // ### is globalExec ok ?
 
       if (exec->hadException()) {
@@ -386,7 +386,7 @@ bool EventConstructor::getOwnPropertySlot(ExecState *exec, const Identifier& pro
 ValueImp *EventConstructor::getValueProperty(ExecState *, int token) const
 {
   // We use the token as the value to return directly
-  return Number(token);
+  return jsNumber(token);
 }
 
 ValueImp *getEventConstructor(ExecState *exec)
@@ -451,24 +451,24 @@ ValueImp *DOMEvent::getValueProperty(ExecState *exec, int token) const
   EventImpl &event = *m_impl;
   switch (token) {
   case Type:
-    return String(event.type().domString());
+    return jsString(event.type().domString());
   case Target:
   case SrcElement: /*MSIE extension - "the object that fired the event"*/
     return getDOMNode(exec, event.target());
   case CurrentTarget:
     return getDOMNode(exec, event.currentTarget());
   case EventPhase:
-    return Number((unsigned int)event.eventPhase());
+    return jsNumber(event.eventPhase());
   case Bubbles:
-    return Boolean(event.bubbles());
+    return jsBoolean(event.bubbles());
   case CancelBubble:
-    return Boolean(event.getCancelBubble());
+    return jsBoolean(event.getCancelBubble());
   case ReturnValue:
-    return Boolean(!event.defaultPrevented());
+    return jsBoolean(!event.defaultPrevented());
   case Cancelable:
-    return Boolean(event.cancelable());
+    return jsBoolean(event.cancelable());
   case TimeStamp:
-    return Number(event.timeStamp());
+    return jsNumber(event.timeStamp());
   case ClipboardData:
   {
     if (event.isClipboardEvent()) {
@@ -478,7 +478,7 @@ ValueImp *DOMEvent::getValueProperty(ExecState *exec, int token) const
       }
       return clipboard;
     } else {
-      return Undefined();
+      return jsUndefined();
     }
   }
   case DataTransfer:
@@ -490,7 +490,7 @@ ValueImp *DOMEvent::getValueProperty(ExecState *exec, int token) const
       }
       return clipboard;
     } else {
-      return Undefined();
+      return jsUndefined();
     }
   }
   default:
@@ -529,21 +529,21 @@ ValueImp *DOMEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp * thisObj
   switch (id) {
     case DOMEvent::StopPropagation:
       event.stopPropagation();
-      return Undefined();
+      return jsUndefined();
     case DOMEvent::PreventDefault:
       event.preventDefault();
-      return Undefined();
+      return jsUndefined();
     case DOMEvent::InitEvent:
       event.initEvent(AtomicString(args[0]->toString(exec).domString()), args[1]->toBoolean(exec), args[2]->toBoolean(exec));
-      return Undefined();
+      return jsUndefined();
   };
-  return Undefined();
+  return jsUndefined();
 }
 
 ValueImp *getDOMEvent(ExecState *exec, EventImpl *e)
 {
   if (!e)
-    return Null();
+    return jsNull();
   ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
 
   JSLock lock;
@@ -593,7 +593,7 @@ bool EventExceptionConstructor::getOwnPropertySlot(ExecState *exec, const Identi
 ValueImp *EventExceptionConstructor::getValueProperty(ExecState *, int token) const
 {
   // We use the token as the value to return directly
-  return Number(token);
+  return jsNumber(token);
 }
 
 ValueImp *getEventExceptionConstructor(ExecState *exec)
@@ -646,24 +646,24 @@ ValueImp *DOMUIEvent::getValueProperty(ExecState *exec, int token) const
   case View:
     return getDOMAbstractView(exec, event.view());
   case Detail:
-    return Number(event.detail());
+    return jsNumber(event.detail());
   case KeyCode:
-    return Number(event.keyCode());
+    return jsNumber(event.keyCode());
   case CharCode:
-    return Number(event.charCode());
+    return jsNumber(event.charCode());
   case LayerX:
-    return Number(event.layerX());
+    return jsNumber(event.layerX());
   case LayerY:
-    return Number(event.layerY());
+    return jsNumber(event.layerY());
   case PageX:
-    return Number(event.pageX());
+    return jsNumber(event.pageX());
   case PageY:
-    return Number(event.pageY());
+    return jsNumber(event.pageY());
   case Which:
-    return Number(event.which());
+    return jsNumber(event.which());
   default:
     kdWarning() << "Unhandled token in DOMUIEvent::getValueProperty : " << token << endl;
-    return Undefined();
+    return jsUndefined();
   }
 }
 
@@ -679,9 +679,9 @@ ValueImp *DOMUIEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisOb
                           args[2]->toBoolean(exec),
                           toAbstractView(args[3]),
                           args[4]->toInt32(exec));
-      return Undefined();
+      return jsUndefined();
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 // -------------------------------------------------------------------------
@@ -758,30 +758,30 @@ ValueImp *DOMMouseEvent::getValueProperty(ExecState *exec, int token) const
   MouseEventImpl &event = *static_cast<MouseEventImpl *>(impl());
   switch (token) {
   case ScreenX:
-    return Number(event.screenX());
+    return jsNumber(event.screenX());
   case ScreenY:
-    return Number(event.screenY());
+    return jsNumber(event.screenY());
   case ClientX:
   case X:
-    return Number(event.clientX());
+    return jsNumber(event.clientX());
   case ClientY:
   case Y:
-    return Number(event.clientY());
+    return jsNumber(event.clientY());
   case OffsetX: // MSIE extension
-    return Number(offsetFromTarget(&event).x());
+    return jsNumber(offsetFromTarget(&event).x());
   case OffsetY: // MSIE extension
-    return Number(offsetFromTarget(&event).y());
+    return jsNumber(offsetFromTarget(&event).y());
   case CtrlKey:
-    return Boolean(event.ctrlKey());
+    return jsBoolean(event.ctrlKey());
   case ShiftKey:
-    return Boolean(event.shiftKey());
+    return jsBoolean(event.shiftKey());
   case AltKey:
-    return Boolean(event.altKey());
+    return jsBoolean(event.altKey());
   case MetaKey:
-    return Boolean(event.metaKey());
+    return jsBoolean(event.metaKey());
   case Button:
     // WinIE uses 1,4,2 for left/middle/right but not for click (just for mousedown/up, maybe others), but we will match the standard DOM.
-    return Number(event.button());
+    return jsNumber(event.button());
   case ToElement:
     // MSIE extension - "the object toward which the user is moving the mouse pointer"
     return getDOMNode(exec, event.type() == mouseoutEvent ? event.relatedTarget() : event.target());
@@ -818,9 +818,9 @@ ValueImp *DOMMouseEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thi
                                 args[12]->toBoolean(exec), // metaKeyArg
                                 args[13]->toInt32(exec), // buttonArg
                                 toNode(args[14])); // relatedTargetArg
-      return Undefined();
+      return jsUndefined();
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 // -------------------------------------------------------------------------
@@ -870,19 +870,19 @@ ValueImp *DOMKeyboardEvent::getValueProperty(ExecState *exec, int token) const
   KeyboardEventImpl &event = *static_cast<KeyboardEventImpl *>(impl());
   switch (token) {
   case KeyIdentifier:
-    return String(event.keyIdentifier());
+    return jsString(event.keyIdentifier());
   case KeyLocation:
-    return Number(event.keyLocation());
+    return jsNumber(event.keyLocation());
   case CtrlKey:
-    return Boolean(event.ctrlKey());
+    return jsBoolean(event.ctrlKey());
   case ShiftKey:
-    return Boolean(event.shiftKey());
+    return jsBoolean(event.shiftKey());
   case AltKey:
-    return Boolean(event.altKey());
+    return jsBoolean(event.altKey());
   case MetaKey:
-    return Boolean(event.metaKey());
+    return jsBoolean(event.metaKey());
   case AltGraphKey:
-    return Boolean(event.altGraphKey());
+    return jsBoolean(event.altGraphKey());
   default:
     kdWarning() << "Unhandled token in DOMKeyboardEvent::getValueProperty : " << token << endl;
     return NULL;
@@ -907,9 +907,9 @@ ValueImp *DOMKeyboardEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp *
                               args[8]->toBoolean(exec), // shiftKeyArg
                               args[9]->toBoolean(exec), // metaKeyArg
                               args[10]->toBoolean(exec)); // altGraphKeyArg
-      return Undefined();
+      return jsUndefined();
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 // -------------------------------------------------------------------------
@@ -930,7 +930,7 @@ bool MutationEventConstructor::getOwnPropertySlot(ExecState *exec, const Identif
 ValueImp *MutationEventConstructor::getValueProperty(ExecState *, int token) const
 {
   // We use the token as the value to return directly
-  return Number(token);
+  return jsNumber(token);
 }
 
 ValueImp *getMutationEventConstructor(ExecState *exec)
@@ -979,13 +979,13 @@ ValueImp *DOMMutationEvent::getValueProperty(ExecState *exec, int token) const
   case RelatedNode:
     return getDOMNode(exec, event.relatedNode());
   case PrevValue:
-    return String(event.prevValue());
+    return jsString(event.prevValue());
   case NewValue:
-    return String(event.newValue());
+    return jsString(event.newValue());
   case AttrName:
-    return String(event.attrName());
+    return jsString(event.attrName());
   case AttrChange:
-    return Number(event.attrChange());
+    return jsNumber(event.attrChange());
   default:
     kdWarning() << "Unhandled token in DOMMutationEvent::getValueProperty : " << token << endl;
     return NULL;
@@ -1007,9 +1007,9 @@ ValueImp *DOMMutationEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp *
                                       args[5]->toString(exec).domString(), // newValueArg
                                       args[6]->toString(exec).domString(), // attrNameArg
                                       args[7]->toInt32(exec)); // attrChangeArg
-      return Undefined();
+      return jsUndefined();
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 // -------------------------------------------------------------------------
@@ -1053,38 +1053,38 @@ ValueImp *DOMWheelEvent::getValueProperty(ExecState *exec, int token) const
     DOM::WheelEventImpl *e = static_cast<DOM::WheelEventImpl *>(impl());
     switch (token) {
         case AltKey:
-            return Boolean(e->altKey());
+            return jsBoolean(e->altKey());
         case ClientX:
         case X:
-            return Number(e->clientX());
+            return jsNumber(e->clientX());
         case ClientY:
         case Y:
-            return Number(e->clientY());
+            return jsNumber(e->clientY());
         case CtrlKey:
-            return Number(e->ctrlKey());
+            return jsNumber(e->ctrlKey());
         case MetaKey:
-            return Number(e->metaKey());
+            return jsNumber(e->metaKey());
         case OffsetX:
-            return Number(offsetFromTarget(e).x());
+            return jsNumber(offsetFromTarget(e).x());
         case OffsetY:
-            return Number(offsetFromTarget(e).y());
+            return jsNumber(offsetFromTarget(e).y());
         case ScreenX:
-            return Number(e->screenX());
+            return jsNumber(e->screenX());
         case ScreenY:
-            return Number(e->screenY());
+            return jsNumber(e->screenY());
         case ShiftKey:
-            return Boolean(e->shiftKey());
+            return jsBoolean(e->shiftKey());
         case WheelDelta:
-            return Number(e->wheelDelta());
+            return jsNumber(e->wheelDelta());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *DOMWheelEventProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
     if (!thisObj->inherits(&DOMWheelEvent::info))
         return throwError(exec, TypeError);
-    return Undefined();
+    return jsUndefined();
 }
 
 // -------------------------------------------------------------------------
@@ -1127,9 +1127,9 @@ Clipboard::~Clipboard()
 static ValueImp *stringOrUndefined(const DOM::DOMString &str)
 {
     if (str.isNull()) {
-        return Undefined();
+        return jsUndefined();
     } else {
-        return String(str);
+        return jsString(str);
     }
 }
 
@@ -1151,11 +1151,11 @@ ValueImp *Clipboard::getValueProperty(ExecState *exec, int token) const
         {
             QStringList qTypes = clipboard->types();
             if (qTypes.isEmpty()) {
-                return Null(); 
+                return jsNull(); 
             } else {
                 List list;
                 for (QStringList::Iterator it = qTypes.begin(); it != qTypes.end(); ++it) {
-                    list.append(String(UString(*it)));
+                    list.append(jsString(UString(*it)));
                 }
                 return exec->lexicalInterpreter()->builtinArray()->construct(exec, list);
             }
@@ -1199,10 +1199,10 @@ ValueImp *ClipboardProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj
         case Clipboard::ClearData:
             if (args.size() == 0) {
                 cb->clipboard->clearAllData();
-                return Undefined();
+                return jsUndefined();
             } else if (args.size() == 1) {
                 cb->clipboard->clearData(args[0]->toString(exec).domString());
-                return Undefined();
+                return jsUndefined();
             } else {
                 return throwError(exec, SyntaxError, "clearData: Invalid number of arguments");
             }
@@ -1212,9 +1212,9 @@ ValueImp *ClipboardProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj
                 bool success;
                 DOM::DOMString result = cb->clipboard->getData(args[0]->toString(exec).domString(), success);
                 if (success) {
-                    return String(result);
+                    return jsString(result);
                 } else {
-                    return Undefined();
+                    return jsUndefined();
                 }
             } else {
                 return throwError(exec, SyntaxError, "getData: Invalid number of arguments");
@@ -1222,14 +1222,14 @@ ValueImp *ClipboardProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj
         }
         case Clipboard::SetData:
             if (args.size() == 2) {
-                return Boolean(cb->clipboard->setData(args[0]->toString(exec).domString(), args[1]->toString(exec).domString()));
+                return jsBoolean(cb->clipboard->setData(args[0]->toString(exec).domString(), args[1]->toString(exec).domString()));
             } else {
                 return throwError(exec, SyntaxError, "setData: Invalid number of arguments");
             }
         case Clipboard::SetDragImage:
         {
             if (!cb->clipboard->isForDragging()) {
-                return Undefined();
+                return jsUndefined();
             }
 
             if (args.size() != 3)
@@ -1243,7 +1243,7 @@ ValueImp *ClipboardProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj
             if (node) {
                 if (node->isElementNode()) {
                     cb->clipboard->setDragImageElement(node, QPoint(x,y));                    
-                    return Undefined();
+                    return jsUndefined();
                 } else {
                     return throwError(exec, SyntaxError, "setDragImageFromElement: Invalid first argument");
                 }
@@ -1254,13 +1254,13 @@ ValueImp *ClipboardProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj
             if (o->isObject() && o->inherits(&Image::info)) {
                 Image *JSImage = static_cast<Image*>(o);
                 cb->clipboard->setDragImage(JSImage->image()->pixmap(), QPoint(x,y));                
-                return Undefined();
+                return jsUndefined();
             } else {
                 return throwError(exec, TypeError);
             }
         }
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 }
index 1e184da..9c9d89d 100644 (file)
@@ -159,7 +159,7 @@ ValueImp *KJS::HTMLDocFunction::callAsFunction(ExecState *exec, ObjectImp *thisO
   switch (id) {
   case HTMLDocument::Clear: // even IE doesn't support that one...
     //doc.clear(); // TODO
-    return Undefined();
+    return jsUndefined();
   case HTMLDocument::Open:
     // For compatibility with other browsers, pass open calls with more than 2 parameters to the window.
     if (args.size() > 2) {
@@ -173,15 +173,15 @@ ValueImp *KJS::HTMLDocFunction::callAsFunction(ExecState *exec, ObjectImp *thisO
          return functionObject->call(exec, window, args);
        }
       }
-      return Undefined();
+      return jsUndefined();
     }
     // In the case of two parameters or fewer, do a normal document open.
     doc.open();
-    return Undefined();
+    return jsUndefined();
   case HTMLDocument::Close:
     // see khtmltests/ecma/tokenizer-script-recursion.html
     doc.close();
-    return Undefined();
+    return jsUndefined();
   case HTMLDocument::Write:
   case HTMLDocument::WriteLn: {
     // DOM only specifies single string argument, but NS & IE allow multiple
@@ -193,7 +193,7 @@ ValueImp *KJS::HTMLDocFunction::callAsFunction(ExecState *exec, ObjectImp *thisO
       str += "\n";
     //kdDebug() << "document.write: " << str.ascii() << endl;
     doc.write(str.domString());
-    return Undefined();
+    return jsUndefined();
   }
   case HTMLDocument::GetElementsByName:
     return getDOMNodeList(exec, doc.getElementsByName(args[0]->toString(exec).domString()).get());
@@ -203,7 +203,7 @@ ValueImp *KJS::HTMLDocFunction::callAsFunction(ExecState *exec, ObjectImp *thisO
     break;
   }
 
-  return Undefined();
+  return jsUndefined();
 }
 
 const ClassInfo KJS::HTMLDocument::info =
@@ -296,21 +296,21 @@ ValueImp *HTMLDocument::getValueProperty(ExecState *exec, int token) const
     
   switch (token) {
   case Title:
-    return String(doc.title());
+    return jsString(doc.title());
   case Referrer:
-    return String(doc.referrer());
+    return jsString(doc.referrer());
   case Domain:
-    return String(doc.domain());
+    return jsString(doc.domain());
   case URL:
-    return String(doc.URL());
+    return jsString(doc.URL());
   case Body:
     return getDOMNode(exec, body);
   case Location:
     if (Window* win = Window::retrieveWindow(part))
       return win->location();
-    return Undefined();
+    return jsUndefined();
   case Cookie:
-    return String(doc.cookie());
+    return jsString(doc.cookie());
   case Images:
     return getHTMLCollection(exec, doc.images().get());
   case Embeds:
@@ -328,49 +328,49 @@ ValueImp *HTMLDocument::getValueProperty(ExecState *exec, int token) const
       // To be implemented. Meanwhile, return an object with a length property set to 0
       kdWarning() << "KJS::HTMLDocument document.scripts called - not implemented" << endl;
       ObjectImp *obj = new ObjectImp;
-      obj->put(exec, lengthPropertyName, Number(0));
+      obj->put(exec, lengthPropertyName, jsNumber(0));
       return obj;
     }
   case All:
     // Disable document.all when we try to be Netscape-compatible
     if (exec->dynamicInterpreter()->compatMode() == Interpreter::NetscapeCompat)
-      return Undefined();
+      return jsUndefined();
     return getHTMLCollection(exec, doc.all().get());
   case BgColor:
     if (!bodyElement)
-      return Undefined();
-    return String(bodyElement->bgColor());
+      return jsUndefined();
+    return jsString(bodyElement->bgColor());
   case FgColor:
     if (!bodyElement)
-      return Undefined();
-    return String(bodyElement->text());
+      return jsUndefined();
+    return jsString(bodyElement->text());
   case AlinkColor:
     if (!bodyElement)
-      return Undefined();
-    return String(bodyElement->aLink());
+      return jsUndefined();
+    return jsString(bodyElement->aLink());
   case LinkColor:
     if (!bodyElement)
-      return Undefined();
-    return String(bodyElement->link());
+      return jsUndefined();
+    return jsString(bodyElement->link());
   case VlinkColor:
     if (!bodyElement)
-      return Undefined();
-    return String(bodyElement->vLink());
+      return jsUndefined();
+    return jsString(bodyElement->vLink());
   case LastModified:
-    return String(doc.lastModified());
+    return jsString(doc.lastModified());
   case Height:
-    return Number(view ? view->contentsHeight() : 0);
+    return jsNumber(view ? view->contentsHeight() : 0);
   case Width:
-    return Number(view ? view->contentsWidth() : 0);
+    return jsNumber(view ? view->contentsWidth() : 0);
   case Dir:
     if (!bodyElement)
-      return Undefined();
-    return String(bodyElement->dir());
+      return jsUndefined();
+    return jsString(bodyElement->dir());
   case DesignMode:
-    return String(doc.inDesignMode() ? "on" : "off");
+    return jsString(doc.inDesignMode() ? "on" : "off");
   default:
     assert(0);
-    return Undefined();
+    return jsUndefined();
   }
 }
 
@@ -1293,7 +1293,7 @@ ValueImp *HTMLElement::framesetNameGetter(ExecState *exec, const Identifier& pro
         if (Window *window = Window::retrieveWindow(doc->part()))
             return window;
 
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::frameWindowPropertyGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -1304,7 +1304,7 @@ ValueImp *HTMLElement::frameWindowPropertyGetter(ExecState *exec, const Identifi
         if (Window *window = Window::retrieveWindow(doc->part()))
             return window->get(exec, propertyName);
 
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::runtimeObjectGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -1322,7 +1322,7 @@ ValueImp *HTMLElement::runtimeObjectPropertyGetter(ExecState *exec, const Identi
 
     if (ValueImp *runtimeObject = getRuntimeObject(exec, element))
         return static_cast<ObjectImp *>(runtimeObject)->get(exec, propertyName);
-    return Undefined();
+    return jsUndefined();
 }
 
 bool HTMLElement::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -1435,23 +1435,23 @@ ValueImp *KJS::HTMLElement::callAsFunction(ExecState *exec, ObjectImp *thisObj,
         if (ValueImp *runtimeObject = getRuntimeObject(exec, element))
             return static_cast<ObjectImp *>(runtimeObject)->call(exec, thisObj, args);
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::htmlGetter(ExecState* exec, int token) const
 {
     HTMLHtmlElementImpl& html = *static_cast<HTMLHtmlElementImpl*>(impl());
     if (token == HtmlVersion)
-        return String(html.version());
-    return Undefined();
+        return jsString(html.version());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::headGetter(ExecState* exec, int token) const
 {
     HTMLHeadElementImpl &head = *static_cast<HTMLHeadElementImpl*>(impl());
     if (token == HeadProfile)
-        return String(head.profile());
-    return Undefined();
+        return jsString(head.profile());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::linkGetter(ExecState* exec, int token) const
@@ -1459,57 +1459,57 @@ ValueImp *HTMLElement::linkGetter(ExecState* exec, int token) const
     HTMLLinkElementImpl &link = *static_cast<HTMLLinkElementImpl*>(impl());
     switch (token) {
         case LinkDisabled:
-            return Boolean(link.disabled());
+            return jsBoolean(link.disabled());
         case LinkCharset:
-            return String(link.charset());
+            return jsString(link.charset());
         case LinkHref:
-            return String(link.href());
+            return jsString(link.href());
         case LinkHrefLang:
-            return String(link.hreflang());
+            return jsString(link.hreflang());
         case LinkMedia:           
-            return String(link.media());
+            return jsString(link.media());
         case LinkRel:             
-            return String(link.rel());
+            return jsString(link.rel());
         case LinkRev:            
-            return String(link.rev());
+            return jsString(link.rev());
         case LinkTarget:          
-            return String(link.target());
+            return jsString(link.target());
         case LinkType:            
-            return String(link.type());
+            return jsString(link.type());
         case LinkSheet:           
             return getDOMStyleSheet(exec, link.sheet());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::titleGetter(ExecState* exec, int token) const
 {
     HTMLTitleElementImpl& title = *static_cast<HTMLTitleElementImpl*>(impl());
     if (token == TitleText)
-        return String(title.text());
-    return Undefined();
+        return jsString(title.text());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::metaGetter(ExecState* exec, int token) const
 {
     HTMLMetaElementImpl& meta = *static_cast<HTMLMetaElementImpl*>(impl());
     switch (token) {
-        case MetaContent:         return String(meta.content());
-        case MetaHttpEquiv:       return String(meta.httpEquiv());
-        case MetaName:            return String(meta.name());
-        case MetaScheme:          return String(meta.scheme());
+        case MetaContent:         return jsString(meta.content());
+        case MetaHttpEquiv:       return jsString(meta.httpEquiv());
+        case MetaName:            return jsString(meta.name());
+        case MetaScheme:          return jsString(meta.scheme());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::baseGetter(ExecState* exec, int token) const
 {
     HTMLBaseElementImpl& base = *static_cast<HTMLBaseElementImpl*>(impl());
     switch (token) {
-        case BaseHref:            return String(base.href());
-        case BaseTarget:          return String(base.target());
+        case BaseHref:            return jsString(base.href());
+        case BaseTarget:          return jsString(base.target());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::isIndexGetter(ExecState* exec, int token) const
@@ -1517,33 +1517,33 @@ ValueImp *HTMLElement::isIndexGetter(ExecState* exec, int token) const
     HTMLIsIndexElementImpl& isindex = *static_cast<HTMLIsIndexElementImpl*>(impl());
     switch (token) {
         case IsIndexForm:            return getDOMNode(exec, isindex.form()); // type HTMLFormElement
-        case IsIndexPrompt:          return String(isindex.prompt());
+        case IsIndexPrompt:          return jsString(isindex.prompt());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::styleGetter(ExecState* exec, int token) const
 {
     HTMLStyleElementImpl& style = *static_cast<HTMLStyleElementImpl*>(impl());
     switch (token) {
-        case StyleDisabled:        return Boolean(style.disabled());
-        case StyleMedia:           return String(style.media());
-        case StyleType:            return String(style.type());
+        case StyleDisabled:        return jsBoolean(style.disabled());
+        case StyleMedia:           return jsString(style.media());
+        case StyleType:            return jsString(style.type());
         case StyleSheet:           return getDOMStyleSheet(exec, style.sheet());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::bodyGetter(ExecState* exec, int token) const
 {
     HTMLBodyElementImpl& body = *static_cast<HTMLBodyElementImpl*>(impl());
     switch (token) {
-        case BodyALink:           return String(body.aLink());
-        case BodyBackground:      return String(body.background());
-        case BodyBgColor:         return String(body.bgColor());
-        case BodyLink:            return String(body.link());
-        case BodyText:            return String(body.text());
-        case BodyVLink:           return String(body.vLink());
+        case BodyALink:           return jsString(body.aLink());
+        case BodyBackground:      return jsString(body.background());
+        case BodyBgColor:         return jsString(body.bgColor());
+        case BodyLink:            return jsString(body.link());
+        case BodyText:            return jsString(body.text());
+        case BodyVLink:           return jsString(body.vLink());
         default: {
             // Update the document's layout before we compute these attributes.
             DocumentImpl *doc = body.getDocument();
@@ -1552,17 +1552,17 @@ ValueImp *HTMLElement::bodyGetter(ExecState* exec, int token) const
             KHTMLView *view = doc ? doc->view() : 0;
             switch (token) {
                 case BodyScrollLeft:
-                    return Number(view ? view->contentsX() : 0);
+                    return jsNumber(view ? view->contentsX() : 0);
                 case BodyScrollTop:
-                    return Number(view ? view->contentsY() : 0);
+                    return jsNumber(view ? view->contentsY() : 0);
                 case BodyScrollHeight:
-                    return Number(view ? view->contentsHeight() : 0);
+                    return jsNumber(view ? view->contentsHeight() : 0);
                 case BodyScrollWidth:
-                    return Number(view ? view->contentsWidth() : 0);
+                    return jsNumber(view ? view->contentsWidth() : 0);
             }
         }
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::formGetter(ExecState* exec, int token) const
@@ -1570,44 +1570,44 @@ ValueImp *HTMLElement::formGetter(ExecState* exec, int token) const
     HTMLFormElementImpl& form = *static_cast<HTMLFormElementImpl*>(impl());
     switch (token) {
         case FormElements:        return getHTMLCollection(exec, form.elements().get());
-        case FormLength:          return Number(form.length());
-        case FormName:            return String(form.name());
-        case FormAcceptCharset:   return String(form.acceptCharset());
-        case FormAction:          return String(form.action());
-        case FormEncType:         return String(form.enctype());
-        case FormMethod:          return String(form.method());
-        case FormTarget:          return String(form.target());
+        case FormLength:          return jsNumber(form.length());
+        case FormName:            return jsString(form.name());
+        case FormAcceptCharset:   return jsString(form.acceptCharset());
+        case FormAction:          return jsString(form.action());
+        case FormEncType:         return jsString(form.enctype());
+        case FormMethod:          return jsString(form.method());
+        case FormTarget:          return jsString(form.target());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::selectGetter(ExecState* exec, int token) const
 {
     HTMLSelectElementImpl& select = *static_cast<HTMLSelectElementImpl*>(impl());
     switch (token) {
-        case SelectType:            return String(select.type());
-        case SelectSelectedIndex:   return Number(select.selectedIndex());
-        case SelectValue:           return String(select.value());
-        case SelectLength:          return Number(select.length());
+        case SelectType:            return jsString(select.type());
+        case SelectSelectedIndex:   return jsNumber(select.selectedIndex());
+        case SelectValue:           return jsString(select.value());
+        case SelectLength:          return jsNumber(select.length());
         case SelectForm:            return getDOMNode(exec, select.form()); // type HTMLFormElement
         case SelectOptions:         return getSelectHTMLCollection(exec, select.optionsHTMLCollection().get(), &select); // type HTMLCollection
-        case SelectDisabled:        return Boolean(select.disabled());
-        case SelectMultiple:        return Boolean(select.multiple());
-        case SelectName:            return String(select.name());
-        case SelectSize:            return Number(select.size());
-        case SelectTabIndex:        return Number(select.tabIndex());
+        case SelectDisabled:        return jsBoolean(select.disabled());
+        case SelectMultiple:        return jsBoolean(select.multiple());
+        case SelectName:            return jsString(select.name());
+        case SelectSize:            return jsNumber(select.size());
+        case SelectTabIndex:        return jsNumber(select.tabIndex());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::optGroupGetter(ExecState* exec, int token) const
 {
     HTMLOptGroupElementImpl& optgroup = *static_cast<HTMLOptGroupElementImpl*>(impl());
     switch (token) {
-        case OptGroupDisabled:        return Boolean(optgroup.disabled());
-        case OptGroupLabel:           return String(optgroup.label());
+        case OptGroupDisabled:        return jsBoolean(optgroup.disabled());
+        case OptGroupLabel:           return jsString(optgroup.label());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::optionGetter(ExecState* exec, int token) const
@@ -1615,73 +1615,73 @@ ValueImp *HTMLElement::optionGetter(ExecState* exec, int token) const
     HTMLOptionElementImpl& option = *static_cast<HTMLOptionElementImpl*>(impl());
     switch (token) {
         case OptionForm:            return getDOMNode(exec,option.form()); // type HTMLFormElement
-        case OptionDefaultSelected: return Boolean(option.defaultSelected());
-        case OptionText:            return String(option.text());
-        case OptionIndex:           return Number(option.index());
-        case OptionDisabled:        return Boolean(option.disabled());
-        case OptionLabel:           return String(option.label());
-        case OptionSelected:        return Boolean(option.selected());
-        case OptionValue:           return String(option.value());
+        case OptionDefaultSelected: return jsBoolean(option.defaultSelected());
+        case OptionText:            return jsString(option.text());
+        case OptionIndex:           return jsNumber(option.index());
+        case OptionDisabled:        return jsBoolean(option.disabled());
+        case OptionLabel:           return jsString(option.label());
+        case OptionSelected:        return jsBoolean(option.selected());
+        case OptionValue:           return jsString(option.value());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 static ValueImp *getInputSelectionStart(HTMLInputElementImpl &input)
 {
     if (input.canHaveSelection())
-        return Number(input.selectionStart());
-    return Undefined();
+        return jsNumber(input.selectionStart());
+    return jsUndefined();
 }
 
 static ValueImp *getInputSelectionEnd(HTMLInputElementImpl &input)
 {
     if (input.canHaveSelection())
-        return Number(input.selectionEnd());
-    return Undefined();
+        return jsNumber(input.selectionEnd());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::inputGetter(ExecState* exec, int token) const
 {
     HTMLInputElementImpl& input = *static_cast<HTMLInputElementImpl*>(impl());
     switch (token) {
-        case InputDefaultValue:    return String(input.defaultValue());
-        case InputDefaultChecked:  return Boolean(input.defaultChecked());
+        case InputDefaultValue:    return jsString(input.defaultValue());
+        case InputDefaultChecked:  return jsBoolean(input.defaultChecked());
         case InputForm:            return getDOMNode(exec,input.form()); // type HTMLFormElement
-        case InputAccept:          return String(input.accept());
-        case InputAccessKey:       return String(input.accessKey());
-        case InputAlign:           return String(input.align());
-        case InputAlt:             return String(input.alt());
-        case InputChecked:         return Boolean(input.checked());
-        case InputDisabled:        return Boolean(input.disabled());
-        case InputIndeterminate:   return Boolean(input.indeterminate());
-        case InputMaxLength:       return Number(input.maxLength());
-        case InputName:            return String(input.name());
-        case InputReadOnly:        return Boolean(input.readOnly());
+        case InputAccept:          return jsString(input.accept());
+        case InputAccessKey:       return jsString(input.accessKey());
+        case InputAlign:           return jsString(input.align());
+        case InputAlt:             return jsString(input.alt());
+        case InputChecked:         return jsBoolean(input.checked());
+        case InputDisabled:        return jsBoolean(input.disabled());
+        case InputIndeterminate:   return jsBoolean(input.indeterminate());
+        case InputMaxLength:       return jsNumber(input.maxLength());
+        case InputName:            return jsString(input.name());
+        case InputReadOnly:        return jsBoolean(input.readOnly());
         case InputSelectionStart:  return getInputSelectionStart(input);
         case InputSelectionEnd:    return getInputSelectionEnd(input);
-        case InputSize:            return Number(input.size());
-        case InputSrc:             return String(input.src());
-        case InputTabIndex:        return Number(input.tabIndex());
-        case InputType:            return String(input.type());
-        case InputUseMap:          return String(input.useMap());
-        case InputValue:           return String(input.value());
+        case InputSize:            return jsNumber(input.size());
+        case InputSrc:             return jsString(input.src());
+        case InputTabIndex:        return jsNumber(input.tabIndex());
+        case InputType:            return jsString(input.type());
+        case InputUseMap:          return jsString(input.useMap());
+        case InputValue:           return jsString(input.value());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::textAreaGetter(ExecState* exec, int token) const
 {
     HTMLTextAreaElementImpl& textarea = *static_cast<HTMLTextAreaElementImpl*>(impl());
     switch (token) {
-        case TextAreaDefaultValue:    return String(textarea.defaultValue());
+        case TextAreaDefaultValue:    return jsString(textarea.defaultValue());
         case TextAreaForm:            return getDOMNode(exec,textarea.form()); // type HTMLFormElement
-        case TextAreaAccessKey:       return String(textarea.accessKey());
-        case TextAreaCols:            return Number(textarea.cols());
-        case TextAreaDisabled:        return Boolean(textarea.disabled());
-        case TextAreaName:            return String(textarea.name());
-        case TextAreaReadOnly:        return Boolean(textarea.readOnly());
-        case TextAreaRows:            return Number(textarea.rows());
-        case TextAreaSelectionStart:  return Number(textarea.selectionStart());
+        case TextAreaAccessKey:       return jsString(textarea.accessKey());
+        case TextAreaCols:            return jsNumber(textarea.cols());
+        case TextAreaDisabled:        return jsBoolean(textarea.disabled());
+        case TextAreaName:            return jsString(textarea.name());
+        case TextAreaReadOnly:        return jsBoolean(textarea.readOnly());
+        case TextAreaRows:            return jsNumber(textarea.rows());
+        case TextAreaSelectionStart:  return jsNumber(textarea.selectionStart());
         case TextAreaSelectionEnd:
             // FIXME (4363497): Work-around to prevent regression caused by GMail bug (4344954).
             // For the love of all that is holy, let's remove this code as soon as
@@ -1689,12 +1689,12 @@ ValueImp *HTMLElement::textAreaGetter(ExecState* exec, int token) const
             if (impl() && impl()->getDocument() && (impl()->getDocument()->domain() == "mail.google.com"))
                     return jsUndefined();
             
-            return Number(textarea.selectionEnd());
-        case TextAreaTabIndex:        return Number(textarea.tabIndex());
-        case TextAreaType:            return String(textarea.type());
-        case TextAreaValue:           return String(textarea.value());
+            return jsNumber(textarea.selectionEnd());
+        case TextAreaTabIndex:        return jsNumber(textarea.tabIndex());
+        case TextAreaType:            return jsString(textarea.type());
+        case TextAreaValue:           return jsString(textarea.value());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::buttonGetter(ExecState* exec, int token) const
@@ -1702,14 +1702,14 @@ ValueImp *HTMLElement::buttonGetter(ExecState* exec, int token) const
     HTMLButtonElementImpl& button = *static_cast<HTMLButtonElementImpl*>(impl());
     switch (token) {
         case ButtonForm:            return getDOMNode(exec,button.form()); // type HTMLFormElement
-        case ButtonAccessKey:       return String(button.accessKey());
-        case ButtonDisabled:        return Boolean(button.disabled());
-        case ButtonName:            return String(button.name());
-        case ButtonTabIndex:        return Number(button.tabIndex());
-        case ButtonType:            return String(button.type());
-        case ButtonValue:           return String(button.value());
+        case ButtonAccessKey:       return jsString(button.accessKey());
+        case ButtonDisabled:        return jsBoolean(button.disabled());
+        case ButtonName:            return jsString(button.name());
+        case ButtonTabIndex:        return jsNumber(button.tabIndex());
+        case ButtonType:            return jsString(button.type());
+        case ButtonValue:           return jsString(button.value());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::labelGetter(ExecState* exec, int token) const
@@ -1717,10 +1717,10 @@ ValueImp *HTMLElement::labelGetter(ExecState* exec, int token) const
     HTMLLabelElementImpl& label = *static_cast<HTMLLabelElementImpl*>(impl());
     switch (token) {
         case LabelForm:            return getDOMNode(exec,label.form()); // type HTMLFormElement
-        case LabelAccessKey:       return String(label.accessKey());
-        case LabelHtmlFor:         return String(label.htmlFor());
+        case LabelAccessKey:       return jsString(label.accessKey());
+        case LabelHtmlFor:         return jsString(label.htmlFor());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::fieldSetGetter(ExecState* exec, int token) const
@@ -1728,7 +1728,7 @@ ValueImp *HTMLElement::fieldSetGetter(ExecState* exec, int token) const
     HTMLFieldSetElementImpl& fieldSet = *static_cast<HTMLFieldSetElementImpl*>(impl());
     if (token == FieldSetForm)
         return getDOMNode(exec,fieldSet.form()); // type HTMLFormElement
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::legendGetter(ExecState* exec, int token) const
@@ -1736,105 +1736,105 @@ ValueImp *HTMLElement::legendGetter(ExecState* exec, int token) const
     HTMLLegendElementImpl& legend = *static_cast<HTMLLegendElementImpl*>(impl());
     switch (token) {
         case LegendForm:            return getDOMNode(exec,legend.form()); // type HTMLFormElement
-        case LegendAccessKey:       return String(legend.accessKey());
-        case LegendAlign:           return String(legend.align());
+        case LegendAccessKey:       return jsString(legend.accessKey());
+        case LegendAlign:           return jsString(legend.align());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::uListGetter(ExecState* exec, int token) const
 {
     HTMLUListElementImpl& uList = *static_cast<HTMLUListElementImpl*>(impl());
     switch (token) {
-        case UListCompact:         return Boolean(uList.compact());
-        case UListType:            return String(uList.type());
+        case UListCompact:         return jsBoolean(uList.compact());
+        case UListType:            return jsString(uList.type());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::oListGetter(ExecState* exec, int token) const
 {
     HTMLOListElementImpl& oList = *static_cast<HTMLOListElementImpl*>(impl());
     switch (token) {
-        case OListCompact:         return Boolean(oList.compact());
-        case OListStart:           return Number(oList.start());
-        case OListType:            return String(oList.type());
+        case OListCompact:         return jsBoolean(oList.compact());
+        case OListStart:           return jsNumber(oList.start());
+        case OListType:            return jsString(oList.type());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::dListGetter(ExecState* exec, int token) const
 {
     HTMLDListElementImpl& dList = *static_cast<HTMLDListElementImpl*>(impl());
     if (token == DListCompact)
-        return Boolean(dList.compact());
-    return Undefined();
+        return jsBoolean(dList.compact());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::dirGetter(ExecState* exec, int token) const
 {
     HTMLDirectoryElementImpl& dir = *static_cast<HTMLDirectoryElementImpl*>(impl());
     if (token == DirectoryCompact)
-        return Boolean(dir.compact());
-    return Undefined();
+        return jsBoolean(dir.compact());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::menuGetter(ExecState* exec, int token) const
 {
     HTMLMenuElementImpl& menu = *static_cast<HTMLMenuElementImpl*>(impl());
     if (token == MenuCompact)
-        return Boolean(menu.compact());
-    return Undefined();
+        return jsBoolean(menu.compact());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::liGetter(ExecState* exec, int token) const
 {
     HTMLLIElementImpl& li = *static_cast<HTMLLIElementImpl*>(impl());
     switch (token) {
-        case LIType:            return String(li.type());
-        case LIValue:           return Number(li.value());
+        case LIType:            return jsString(li.type());
+        case LIValue:           return jsNumber(li.value());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::divGetter(ExecState* exec, int token) const
 {
     HTMLDivElementImpl& div = *static_cast<HTMLDivElementImpl*>(impl());
     if (token == DivAlign)
-        return String(div.align());
-    return Undefined();
+        return jsString(div.align());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::paragraphGetter(ExecState* exec, int token) const
 {
     HTMLParagraphElementImpl& p = *static_cast<HTMLParagraphElementImpl*>(impl());
     if (token == ParagraphAlign)
-        return String(p.align());
-    return Undefined();
+        return jsString(p.align());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::headingGetter(ExecState* exec, int token) const
 {
     HTMLHeadingElementImpl& h = *static_cast<HTMLHeadingElementImpl*>(impl());
     if (token == HeadingAlign)
-        return String(h.align());
-    return Undefined();
+        return jsString(h.align());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::blockQuoteGetter(ExecState* exec, int token) const
 {
     HTMLBlockquoteElementImpl& blockQuote = *static_cast<HTMLBlockquoteElementImpl*>(impl());
     if (token == BlockQuoteCite)
-        return String(blockQuote.cite());
-    return Undefined();
+        return jsString(blockQuote.cite());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::quoteGetter(ExecState* exec, int token) const
 {
     HTMLQuoteElementImpl& quote = *static_cast<HTMLQuoteElementImpl*>(impl());
     if (token == QuoteCite)
-        return String(quote.cite());
-    return Undefined();
+        return jsString(quote.cite());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::preGetter(ExecState* exec, int token) const
@@ -1842,122 +1842,122 @@ ValueImp *HTMLElement::preGetter(ExecState* exec, int token) const
     // FIXME: Add support for 'wrap' when white-space: pre-wrap is implemented.
     HTMLPreElementImpl& pre = *static_cast<HTMLPreElementImpl*>(impl());
     if (token == PreWidth)
-        return Number(pre.width());
+        return jsNumber(pre.width());
     if (token == PreWrap)
-        return Boolean(pre.wrap());
-    return Undefined();
+        return jsBoolean(pre.wrap());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::brGetter(ExecState* exec, int token) const
 {
     HTMLBRElementImpl& br = *static_cast<HTMLBRElementImpl*>(impl());
     if (token == BRClear)
-        return String(br.clear());
-    return Undefined();
+        return jsString(br.clear());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::baseFontGetter(ExecState* exec, int token) const
 {
     HTMLBaseFontElementImpl& baseFont = *static_cast<HTMLBaseFontElementImpl*>(impl());
     switch (token) {
-        case BaseFontColor:           return String(baseFont.color());
-        case BaseFontFace:            return String(baseFont.face());
-        case BaseFontSize:            return String(baseFont.size());
+        case BaseFontColor:           return jsString(baseFont.color());
+        case BaseFontFace:            return jsString(baseFont.face());
+        case BaseFontSize:            return jsString(baseFont.size());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::fontGetter(ExecState* exec, int token) const
 {
     HTMLFontElementImpl& font = *static_cast<HTMLFontElementImpl*>(impl());
     switch (token) {
-        case FontColor:           return String(font.color());
-        case FontFace:            return String(font.face());
-        case FontSize:            return String(font.size());
+        case FontColor:           return jsString(font.color());
+        case FontFace:            return jsString(font.face());
+        case FontSize:            return jsString(font.size());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::hrGetter(ExecState* exec, int token) const
 {
     HTMLHRElementImpl& hr = *static_cast<HTMLHRElementImpl*>(impl());
     switch (token) {
-        case HRAlign:           return String(hr.align());
-        case HRNoShade:         return Boolean(hr.noShade());
-        case HRSize:            return String(hr.size());
-        case HRWidth:           return String(hr.width());
+        case HRAlign:           return jsString(hr.align());
+        case HRNoShade:         return jsBoolean(hr.noShade());
+        case HRSize:            return jsString(hr.size());
+        case HRWidth:           return jsString(hr.width());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::modGetter(ExecState* exec, int token) const
 {
     HTMLModElementImpl& mod = *static_cast<HTMLModElementImpl*>(impl());
     switch (token) {
-        case ModCite:            return String(mod.cite());
-        case ModDateTime:        return String(mod.dateTime());
+        case ModCite:            return jsString(mod.cite());
+        case ModDateTime:        return jsString(mod.dateTime());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::anchorGetter(ExecState* exec, int token) const
 {
     HTMLAnchorElementImpl& anchor = *static_cast<HTMLAnchorElementImpl*>(impl());
     switch (token) {
-        case AnchorAccessKey:       return String(anchor.accessKey());
-        case AnchorCharset:         return String(anchor.charset());
-        case AnchorCoords:          return String(anchor.coords());
-        case AnchorHref:            return String(anchor.href());
-        case AnchorHrefLang:        return String(anchor.hreflang());
-        case AnchorHash:            return String('#'+KURL(anchor.href().qstring()).ref());
-        case AnchorHost:            return String(KURL(anchor.href().qstring()).host());
+        case AnchorAccessKey:       return jsString(anchor.accessKey());
+        case AnchorCharset:         return jsString(anchor.charset());
+        case AnchorCoords:          return jsString(anchor.coords());
+        case AnchorHref:            return jsString(anchor.href());
+        case AnchorHrefLang:        return jsString(anchor.hreflang());
+        case AnchorHash:            return jsString('#'+KURL(anchor.href().qstring()).ref());
+        case AnchorHost:            return jsString(KURL(anchor.href().qstring()).host());
         case AnchorHostname: {
             KURL url(anchor.href().qstring());
             kdDebug(6070) << "anchor::hostname uses:" <<url.url()<<endl;
             if (url.port()==0)
-                return String(url.host());
+                return jsString(url.host());
             else
-                return String(url.host() + ":" + QString::number(url.port()));
+                return jsString(url.host() + ":" + QString::number(url.port()));
         }
-        case AnchorPathName:        return String(KURL(anchor.href().qstring()).path());
-        case AnchorPort:            return String(QString::number(KURL(anchor.href().qstring()).port()));
-        case AnchorProtocol:        return String(KURL(anchor.href().qstring()).protocol()+":");
-        case AnchorSearch:          return String(KURL(anchor.href().qstring()).query());
-        case AnchorName:            return String(anchor.name());
-        case AnchorRel:             return String(anchor.rel());
-        case AnchorRev:             return String(anchor.rev());
-        case AnchorShape:           return String(anchor.shape());
-        case AnchorTabIndex:        return Number(anchor.tabIndex());
-        case AnchorTarget:          return String(anchor.target());
-        case AnchorType:            return String(anchor.type());
+        case AnchorPathName:        return jsString(KURL(anchor.href().qstring()).path());
+        case AnchorPort:            return jsString(QString::number(KURL(anchor.href().qstring()).port()));
+        case AnchorProtocol:        return jsString(KURL(anchor.href().qstring()).protocol()+":");
+        case AnchorSearch:          return jsString(KURL(anchor.href().qstring()).query());
+        case AnchorName:            return jsString(anchor.name());
+        case AnchorRel:             return jsString(anchor.rel());
+        case AnchorRev:             return jsString(anchor.rev());
+        case AnchorShape:           return jsString(anchor.shape());
+        case AnchorTabIndex:        return jsNumber(anchor.tabIndex());
+        case AnchorTarget:          return jsString(anchor.target());
+        case AnchorType:            return jsString(anchor.type());
         case AnchorText:
             if (DocumentImpl* doc = anchor.getDocument())
                 doc->updateLayoutIgnorePendingStylesheets();
-            return String(anchor.innerText());
+            return jsString(anchor.innerText());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::imageGetter(ExecState* exec, int token) const
 {
     HTMLImageElementImpl& image = *static_cast<HTMLImageElementImpl*>(impl());
     switch (token) {
-        case ImageName:            return String(image.name());
-        case ImageAlign:           return String(image.align());
-        case ImageAlt:             return String(image.alt());
-        case ImageBorder:          return Number(image.border());
-        case ImageHeight:          return Number(image.height(true));
-        case ImageHspace:          return Number(image.hspace());
-        case ImageIsMap:           return Boolean(image.isMap());
-        case ImageLongDesc:        return String(image.longDesc());
-        case ImageSrc:             return String(image.src());
-        case ImageUseMap:          return String(image.useMap());
-        case ImageVspace:          return Number(image.vspace());
-        case ImageWidth:           return Number(image.width(true));
-        case ImageX:               return Number(image.x());
-        case ImageY:               return Number(image.y());
-    }
-    return Undefined();
+        case ImageName:            return jsString(image.name());
+        case ImageAlign:           return jsString(image.align());
+        case ImageAlt:             return jsString(image.alt());
+        case ImageBorder:          return jsNumber(image.border());
+        case ImageHeight:          return jsNumber(image.height(true));
+        case ImageHspace:          return jsNumber(image.hspace());
+        case ImageIsMap:           return jsBoolean(image.isMap());
+        case ImageLongDesc:        return jsString(image.longDesc());
+        case ImageSrc:             return jsString(image.src());
+        case ImageUseMap:          return jsString(image.useMap());
+        case ImageVspace:          return jsNumber(image.vspace());
+        case ImageWidth:           return jsNumber(image.width(true));
+        case ImageX:               return jsNumber(image.x());
+        case ImageY:               return jsNumber(image.y());
+    }
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::objectGetter(ExecState* exec, int token) const
@@ -1965,58 +1965,58 @@ ValueImp *HTMLElement::objectGetter(ExecState* exec, int token) const
     HTMLObjectElementImpl& object = *static_cast<HTMLObjectElementImpl*>(impl());
     switch (token) {
         case ObjectForm:            return getDOMNode(exec,object.form()); // type HTMLFormElement
-        case ObjectCode:            return String(object.code());
-        case ObjectAlign:           return String(object.align());
-        case ObjectArchive:         return String(object.archive());
-        case ObjectBorder:          return String(object.border());
-        case ObjectCodeBase:        return String(object.codeBase());
-        case ObjectCodeType:        return String(object.codeType());
+        case ObjectCode:            return jsString(object.code());
+        case ObjectAlign:           return jsString(object.align());
+        case ObjectArchive:         return jsString(object.archive());
+        case ObjectBorder:          return jsString(object.border());
+        case ObjectCodeBase:        return jsString(object.codeBase());
+        case ObjectCodeType:        return jsString(object.codeType());
         case ObjectContentDocument: return checkNodeSecurity(exec,object.contentDocument()) ? 
-                                           getDOMNode(exec, object.contentDocument()) : Undefined();
-        case ObjectData:            return String(object.data());
-        case ObjectDeclare:         return Boolean(object.declare());
-        case ObjectHeight:          return String(object.height());
-        case ObjectHspace:          return String(object.hspace());
-        case ObjectName:            return String(object.name());
-        case ObjectStandby:         return String(object.standby());
-        case ObjectTabIndex:        return Number(object.tabIndex());
-        case ObjectType:            return String(object.type());
-        case ObjectUseMap:          return String(object.useMap());
-        case ObjectVspace:          return String(object.vspace());
-        case ObjectWidth:           return String(object.width());
-    }
-    return Undefined();
+                                           getDOMNode(exec, object.contentDocument()) : jsUndefined();
+        case ObjectData:            return jsString(object.data());
+        case ObjectDeclare:         return jsBoolean(object.declare());
+        case ObjectHeight:          return jsString(object.height());
+        case ObjectHspace:          return jsString(object.hspace());
+        case ObjectName:            return jsString(object.name());
+        case ObjectStandby:         return jsString(object.standby());
+        case ObjectTabIndex:        return jsNumber(object.tabIndex());
+        case ObjectType:            return jsString(object.type());
+        case ObjectUseMap:          return jsString(object.useMap());
+        case ObjectVspace:          return jsString(object.vspace());
+        case ObjectWidth:           return jsString(object.width());
+    }
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::paramGetter(ExecState* exec, int token) const
 {
     HTMLParamElementImpl& param = *static_cast<HTMLParamElementImpl*>(impl());
     switch (token) {
-        case ParamName:            return String(param.name());
-        case ParamType:            return String(param.type());
-        case ParamValue:           return String(param.value());
-        case ParamValueType:       return String(param.valueType());
+        case ParamName:            return jsString(param.name());
+        case ParamType:            return jsString(param.type());
+        case ParamValue:           return jsString(param.value());
+        case ParamValueType:       return jsString(param.valueType());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::appletGetter(ExecState* exec, int token) const
 {
     HTMLAppletElementImpl& applet = *static_cast<HTMLAppletElementImpl*>(impl());
     switch (token) {
-        case AppletAlign:           return String(applet.align());
-        case AppletAlt:             return String(applet.alt());
-        case AppletArchive:         return String(applet.archive());
-        case AppletCode:            return String(applet.code());
-        case AppletCodeBase:        return String(applet.codeBase());
-        case AppletHeight:          return String(applet.height());
-        case AppletHspace:          return String(applet.hspace());
-        case AppletName:            return String(applet.name());
-        case AppletObject:          return String(applet.object());
-        case AppletVspace:          return String(applet.vspace());
-        case AppletWidth:           return String(applet.width());
+        case AppletAlign:           return jsString(applet.align());
+        case AppletAlt:             return jsString(applet.alt());
+        case AppletArchive:         return jsString(applet.archive());
+        case AppletCode:            return jsString(applet.code());
+        case AppletCodeBase:        return jsString(applet.codeBase());
+        case AppletHeight:          return jsString(applet.height());
+        case AppletHspace:          return jsString(applet.hspace());
+        case AppletName:            return jsString(applet.name());
+        case AppletObject:          return jsString(applet.object());
+        case AppletVspace:          return jsString(applet.vspace());
+        case AppletWidth:           return jsString(applet.width());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::mapGetter(ExecState* exec, int token) const
@@ -2024,54 +2024,54 @@ ValueImp *HTMLElement::mapGetter(ExecState* exec, int token) const
     HTMLMapElementImpl& map = *static_cast<HTMLMapElementImpl*>(impl());
     switch (token) {
         case MapAreas:           return getHTMLCollection(exec, map.areas().get()); // type HTMLCollection
-        case MapName:            return String(map.name());
+        case MapName:            return jsString(map.name());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::areaGetter(ExecState* exec, int token) const
 {
     HTMLAreaElementImpl& area = *static_cast<HTMLAreaElementImpl*>(impl());
     switch (token) {
-        case AreaAccessKey:       return String(area.accessKey());
-        case AreaAlt:             return String(area.alt());
-        case AreaCoords:          return String(area.coords());
-        case AreaHref:            return String(area.href());
-        case AreaHash:            return String('#'+KURL(area.href().qstring()).ref());
-        case AreaHost:            return String(KURL(area.href().qstring()).host());
+        case AreaAccessKey:       return jsString(area.accessKey());
+        case AreaAlt:             return jsString(area.alt());
+        case AreaCoords:          return jsString(area.coords());
+        case AreaHref:            return jsString(area.href());
+        case AreaHash:            return jsString('#'+KURL(area.href().qstring()).ref());
+        case AreaHost:            return jsString(KURL(area.href().qstring()).host());
         case AreaHostName: {
             KURL url(area.href().qstring());
             kdDebug(6070) << "link::hostname uses:" <<url.url()<<endl;
             if (url.port()==0)
-                return String(url.host());
+                return jsString(url.host());
             else
-                return String(url.host() + ":" + QString::number(url.port()));
+                return jsString(url.host() + ":" + QString::number(url.port()));
         }
-        case AreaPathName:        return String(KURL(area.href().qstring()).path());
-        case AreaPort:            return String(QString::number(KURL(area.href().qstring()).port()));
-        case AreaProtocol:        return String(KURL(area.href().qstring()).protocol()+":");
-        case AreaSearch:          return String(KURL(area.href().qstring()).query());
-        case AreaNoHref:          return Boolean(area.noHref());
-        case AreaShape:           return String(area.shape());
-        case AreaTabIndex:        return Number(area.tabIndex());
-        case AreaTarget:          return String(area.target());
+        case AreaPathName:        return jsString(KURL(area.href().qstring()).path());
+        case AreaPort:            return jsString(QString::number(KURL(area.href().qstring()).port()));
+        case AreaProtocol:        return jsString(KURL(area.href().qstring()).protocol()+":");
+        case AreaSearch:          return jsString(KURL(area.href().qstring()).query());
+        case AreaNoHref:          return jsBoolean(area.noHref());
+        case AreaShape:           return jsString(area.shape());
+        case AreaTabIndex:        return jsNumber(area.tabIndex());
+        case AreaTarget:          return jsString(area.target());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::scriptGetter(ExecState* exec, int token) const
 {
     HTMLScriptElementImpl& script = *static_cast<HTMLScriptElementImpl*>(impl());
     switch (token) {
-        case ScriptText:            return String(script.text());
-        case ScriptHtmlFor:         return String(script.htmlFor());
-        case ScriptEvent:           return String(script.event());
-        case ScriptCharset:         return String(script.charset());
-        case ScriptDefer:           return Boolean(script.defer());
-        case ScriptSrc:             return String(script.src());
-        case ScriptType:            return String(script.type());
+        case ScriptText:            return jsString(script.text());
+        case ScriptHtmlFor:         return jsString(script.htmlFor());
+        case ScriptEvent:           return jsString(script.event());
+        case ScriptCharset:         return jsString(script.charset());
+        case ScriptDefer:           return jsBoolean(script.defer());
+        case ScriptSrc:             return jsString(script.src());
+        case ScriptType:            return jsString(script.type());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::tableGetter(ExecState* exec, int token) const
@@ -2083,101 +2083,101 @@ ValueImp *HTMLElement::tableGetter(ExecState* exec, int token) const
         case TableTFoot:           return getDOMNode(exec,table.tFoot()); // type HTMLTableSectionElement
         case TableRows:            return getHTMLCollection(exec, table.rows().get()); // type HTMLCollection
         case TableTBodies:         return getHTMLCollection(exec, table.tBodies().get()); // type HTMLCollection
-        case TableAlign:           return String(table.align());
-        case TableBgColor:         return String(table.bgColor());
-        case TableBorder:          return String(table.border());
-        case TableCellPadding:     return String(table.cellPadding());
-        case TableCellSpacing:     return String(table.cellSpacing());
-        case TableFrame:           return String(table.frame());
-        case TableRules:           return String(table.rules());
-        case TableSummary:         return String(table.summary());
-        case TableWidth:           return String(table.width());
+        case TableAlign:           return jsString(table.align());
+        case TableBgColor:         return jsString(table.bgColor());
+        case TableBorder:          return jsString(table.border());
+        case TableCellPadding:     return jsString(table.cellPadding());
+        case TableCellSpacing:     return jsString(table.cellSpacing());
+        case TableFrame:           return jsString(table.frame());
+        case TableRules:           return jsString(table.rules());
+        case TableSummary:         return jsString(table.summary());
+        case TableWidth:           return jsString(table.width());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::tableCaptionGetter(ExecState* exec, int token) const
 {
     HTMLTableCaptionElementImpl& tableCaption = *static_cast<HTMLTableCaptionElementImpl*>(impl());
     if (token == TableCaptionAlign)
-        return String(tableCaption.align());
-    return Undefined();
+        return jsString(tableCaption.align());
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::tableColGetter(ExecState* exec, int token) const
 {
     HTMLTableColElementImpl& tableCol = *static_cast<HTMLTableColElementImpl*>(impl());
     switch (token) {
-        case TableColAlign:           return String(tableCol.align());
-        case TableColCh:              return String(tableCol.ch());
-        case TableColChOff:           return String(tableCol.chOff());
-        case TableColSpan:            return Number(tableCol.span());
-        case TableColVAlign:          return String(tableCol.vAlign());
-        case TableColWidth:           return String(tableCol.width());
+        case TableColAlign:           return jsString(tableCol.align());
+        case TableColCh:              return jsString(tableCol.ch());
+        case TableColChOff:           return jsString(tableCol.chOff());
+        case TableColSpan:            return jsNumber(tableCol.span());
+        case TableColVAlign:          return jsString(tableCol.vAlign());
+        case TableColWidth:           return jsString(tableCol.width());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::tableSectionGetter(ExecState* exec, int token) const
 {
     HTMLTableSectionElementImpl& tableSection = *static_cast<HTMLTableSectionElementImpl*>(impl());
     switch (token) {
-        case TableSectionAlign:           return String(tableSection.align());
-        case TableSectionCh:              return String(tableSection.ch());
-        case TableSectionChOff:           return String(tableSection.chOff());
-        case TableSectionVAlign:          return String(tableSection.vAlign());
+        case TableSectionAlign:           return jsString(tableSection.align());
+        case TableSectionCh:              return jsString(tableSection.ch());
+        case TableSectionChOff:           return jsString(tableSection.chOff());
+        case TableSectionVAlign:          return jsString(tableSection.vAlign());
         case TableSectionRows:            return getHTMLCollection(exec, tableSection.rows().get()); // type HTMLCollection
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::tableRowGetter(ExecState* exec, int token) const
 {
     HTMLTableRowElementImpl& tableRow = *static_cast<HTMLTableRowElementImpl*>(impl());
     switch (token) {
-        case TableRowRowIndex:        return Number(tableRow.rowIndex());
-        case TableRowSectionRowIndex: return Number(tableRow.sectionRowIndex());
+        case TableRowRowIndex:        return jsNumber(tableRow.rowIndex());
+        case TableRowSectionRowIndex: return jsNumber(tableRow.sectionRowIndex());
         case TableRowCells:           return getHTMLCollection(exec, tableRow.cells().get()); // type HTMLCollection
-        case TableRowAlign:           return String(tableRow.align());
-        case TableRowBgColor:         return String(tableRow.bgColor());
-        case TableRowCh:              return String(tableRow.ch());
-        case TableRowChOff:           return String(tableRow.chOff());
-        case TableRowVAlign:          return String(tableRow.vAlign());
+        case TableRowAlign:           return jsString(tableRow.align());
+        case TableRowBgColor:         return jsString(tableRow.bgColor());
+        case TableRowCh:              return jsString(tableRow.ch());
+        case TableRowChOff:           return jsString(tableRow.chOff());
+        case TableRowVAlign:          return jsString(tableRow.vAlign());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::tableCellGetter(ExecState* exec, int token) const
 {
     HTMLTableCellElementImpl& tableCell = *static_cast<HTMLTableCellElementImpl*>(impl());
     switch (token) {
-        case TableCellCellIndex:       return Number(tableCell.cellIndex());
-        case TableCellAbbr:            return String(tableCell.abbr());
-        case TableCellAlign:           return String(tableCell.align());
-        case TableCellAxis:            return String(tableCell.axis());
-        case TableCellBgColor:         return String(tableCell.bgColor());
-        case TableCellCh:              return String(tableCell.ch());
-        case TableCellChOff:           return String(tableCell.chOff());
-        case TableCellColSpan:         return Number(tableCell.colSpan());
-        case TableCellHeaders:         return String(tableCell.headers());
-        case TableCellHeight:          return String(tableCell.height());
-        case TableCellNoWrap:          return Boolean(tableCell.noWrap());
-        case TableCellRowSpan:         return Number(tableCell.rowSpan());
-        case TableCellScope:           return String(tableCell.scope());
-        case TableCellVAlign:          return String(tableCell.vAlign());
-        case TableCellWidth:           return String(tableCell.width());
-    }
-    return Undefined();
+        case TableCellCellIndex:       return jsNumber(tableCell.cellIndex());
+        case TableCellAbbr:            return jsString(tableCell.abbr());
+        case TableCellAlign:           return jsString(tableCell.align());
+        case TableCellAxis:            return jsString(tableCell.axis());
+        case TableCellBgColor:         return jsString(tableCell.bgColor());
+        case TableCellCh:              return jsString(tableCell.ch());
+        case TableCellChOff:           return jsString(tableCell.chOff());
+        case TableCellColSpan:         return jsNumber(tableCell.colSpan());
+        case TableCellHeaders:         return jsString(tableCell.headers());
+        case TableCellHeight:          return jsString(tableCell.height());
+        case TableCellNoWrap:          return jsBoolean(tableCell.noWrap());
+        case TableCellRowSpan:         return jsNumber(tableCell.rowSpan());
+        case TableCellScope:           return jsString(tableCell.scope());
+        case TableCellVAlign:          return jsString(tableCell.vAlign());
+        case TableCellWidth:           return jsString(tableCell.width());
+    }
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::frameSetGetter(ExecState* exec, int token) const
 {
     HTMLFrameSetElementImpl& frameSet = *static_cast<HTMLFrameSetElementImpl*>(impl());
     switch (token) {
-        case FrameSetCols:            return String(frameSet.cols());
-        case FrameSetRows:            return String(frameSet.rows());
+        case FrameSetCols:            return jsString(frameSet.cols());
+        case FrameSetRows:            return jsString(frameSet.rows());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::frameGetter(ExecState* exec, int token) const
@@ -2185,52 +2185,52 @@ ValueImp *HTMLElement::frameGetter(ExecState* exec, int token) const
     HTMLFrameElementImpl& frameElement = *static_cast<HTMLFrameElementImpl*>(impl());
     switch (token) {
         case FrameContentDocument: return checkNodeSecurity(exec,frameElement.contentDocument()) ? 
-                                          getDOMNode(exec, frameElement.contentDocument()) : Undefined();
+                                          getDOMNode(exec, frameElement.contentDocument()) : jsUndefined();
         case FrameContentWindow:   return checkNodeSecurity(exec,frameElement.contentDocument())
                                         ? Window::retrieve(frameElement.contentPart())
-                                        : Undefined();
-        case FrameFrameBorder:     return String(frameElement.frameBorder());
-        case FrameLongDesc:        return String(frameElement.longDesc());
-        case FrameMarginHeight:    return String(frameElement.marginHeight());
-        case FrameMarginWidth:     return String(frameElement.marginWidth());
-        case FrameName:            return String(frameElement.name());
-        case FrameNoResize:        return Boolean(frameElement.noResize());
-        case FrameScrolling:       return String(frameElement.scrolling());
+                                        : jsUndefined();
+        case FrameFrameBorder:     return jsString(frameElement.frameBorder());
+        case FrameLongDesc:        return jsString(frameElement.longDesc());
+        case FrameMarginHeight:    return jsString(frameElement.marginHeight());
+        case FrameMarginWidth:     return jsString(frameElement.marginWidth());
+        case FrameName:            return jsString(frameElement.name());
+        case FrameNoResize:        return jsBoolean(frameElement.noResize());
+        case FrameScrolling:       return jsString(frameElement.scrolling());
         case FrameSrc:
-        case FrameLocation:        return String(frameElement.src());
+        case FrameLocation:        return jsString(frameElement.src());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::iFrameGetter(ExecState* exec, int token) const
 {
     HTMLIFrameElementImpl& iFrame = *static_cast<HTMLIFrameElementImpl*>(impl());
     switch (token) {
-        case IFrameAlign:                return String(iFrame.align());
+        case IFrameAlign:                return jsString(iFrame.align());
           // ### security check ?
         case IFrameDocument: // non-standard, mapped to contentDocument
         case IFrameContentDocument: return checkNodeSecurity(exec,iFrame.contentDocument()) ? 
-                                      getDOMNode(exec, iFrame.contentDocument()) : Undefined();
+                                      getDOMNode(exec, iFrame.contentDocument()) : jsUndefined();
         case IFrameContentWindow:      return checkNodeSecurity(exec,iFrame.contentDocument()) 
                                         ? Window::retrieve(iFrame.contentPart())
-                                        : Undefined();
-        case IFrameFrameBorder:     return String(iFrame.frameBorder());
-        case IFrameHeight:          return String(iFrame.height());
-        case IFrameLongDesc:        return String(iFrame.longDesc());
-        case IFrameMarginHeight:    return String(iFrame.marginHeight());
-        case IFrameMarginWidth:     return String(iFrame.marginWidth());
-        case IFrameName:            return String(iFrame.name());
-        case IFrameScrolling:       return String(iFrame.scrolling());
-        case IFrameSrc:             return String(iFrame.src());
-        case IFrameWidth:           return String(iFrame.width());
+                                        : jsUndefined();
+        case IFrameFrameBorder:     return jsString(iFrame.frameBorder());
+        case IFrameHeight:          return jsString(iFrame.height());
+        case IFrameLongDesc:        return jsString(iFrame.longDesc());
+        case IFrameMarginHeight:    return jsString(iFrame.marginHeight());
+        case IFrameMarginWidth:     return jsString(iFrame.marginWidth());
+        case IFrameName:            return jsString(iFrame.name());
+        case IFrameScrolling:       return jsString(iFrame.scrolling());
+        case IFrameSrc:             return jsString(iFrame.src());
+        case IFrameWidth:           return jsString(iFrame.width());
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::marqueeGetter(ExecState* exec, int token) const
 {
     // FIXME: Find out what WinIE exposes as properties and implement this.
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *HTMLElement::getValueProperty(ExecState *exec, int token) const
@@ -2239,42 +2239,42 @@ ValueImp *HTMLElement::getValueProperty(ExecState *exec, int token) const
     HTMLElementImpl &element = *static_cast<HTMLElementImpl *>(impl());
     switch (token) {
         case ElementId:
-        // iht.com relies on this value being "" when no id is present.  Other browsers do this as well.
-        // So we use String() instead of String() here.
-        return String(element.id());
+            // iht.com relies on this value being "" when no id is present. Other browsers do this as well.
+            // So we use jsString() instead of jsStringOrNull() here.
+            return jsString(element.id());
         case ElementTitle:
-            return String(element.title());
+            return jsString(element.title());
         case ElementLang:
-            return String(element.lang());
+            return jsString(element.lang());
         case ElementDir:
-            return String(element.dir());
+            return jsString(element.dir());
         case ElementClassName:
-            return String(element.className());
+            return jsString(element.className());
         case ElementInnerHTML:
-            return String(element.innerHTML());
+            return jsString(element.innerHTML());
         case ElementInnerText:
             if (DocumentImpl* doc = impl()->getDocument())
                 doc->updateLayoutIgnorePendingStylesheets();
-            return String(element.innerText());
+            return jsString(element.innerText());
         case ElementOuterHTML:
-            return String(element.outerHTML());
+            return jsString(element.outerHTML());
         case ElementOuterText:
-            return String(element.outerText());
+            return jsString(element.outerText());
         case ElementDocument:
             return getDOMNode(exec,element.ownerDocument());
         case ElementChildren:
             return getHTMLCollection(exec, element.children().get());
         case ElementContentEditable:
-            return String(element.contentEditable());
+            return jsString(element.contentEditable());
         case ElementIsContentEditable:
-            return Boolean(element.isContentEditable());
+            return jsBoolean(element.isContentEditable());
     }
 
     // Now check the properties specific to our element type.
     const Accessors* info = getSetInfo();
     if (info && info->m_getter)
         return (this->*(info->m_getter))(exec, token);
-    return Undefined();
+    return jsUndefined();
 }
 
 UString KJS::HTMLElement::toString(ExecState *exec) const
@@ -2328,7 +2328,7 @@ void KJS::HTMLElement::pushEventHandlerScope(ExecState *exec, ScopeChain &scope)
 HTMLElementFunction::HTMLElementFunction(ExecState *exec, int i, int len)
   : DOMFunction(), id(i)
 {
-  put(exec,lengthPropertyName,Number(len),DontDelete|ReadOnly|DontEnum);
+  put(exec,lengthPropertyName,jsNumber(len),DontDelete|ReadOnly|DontEnum);
 }
 
 ValueImp *KJS::HTMLElementFunction::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
@@ -2343,111 +2343,111 @@ ValueImp *KJS::HTMLElementFunction::callAsFunction(ExecState *exec, ObjectImp *t
         HTMLFormElementImpl &form = static_cast<HTMLFormElementImpl &>(element);
         if (id == KJS::HTMLElement::FormSubmit) {
             form.submit();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::FormReset) {
             form.reset();
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(selectTag)) {
         HTMLSelectElementImpl &select = static_cast<HTMLSelectElementImpl &>(element);
         if (id == KJS::HTMLElement::SelectAdd) {
             select.add(toHTMLElement(args[0]), toHTMLElement(args[1]), exception);
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::SelectRemove) {
             select.remove(int(args[0]->toNumber(exec)));
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::SelectBlur) {
             select.blur();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::SelectFocus) {
             select.focus();
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(inputTag)) {
         HTMLInputElementImpl &input = static_cast<HTMLInputElementImpl &>(element);
         if (id == KJS::HTMLElement::InputBlur) {
             input.blur();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::InputFocus) {
             input.focus();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::InputSelect) {
             input.select();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::InputClick) {
             input.click();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::InputSetSelectionRange) {
             input.setSelectionRange(args[0]->toInt32(exec), args[1]->toInt32(exec));
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(buttonTag)) {
         HTMLButtonElementImpl &button = static_cast<HTMLButtonElementImpl &>(element);
         if (id == KJS::HTMLElement::ButtonBlur) {
             button.blur();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::ButtonFocus) {
             button.focus();
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(labelTag)) {
         HTMLLabelElementImpl &label = static_cast<HTMLLabelElementImpl &>(element);
         if (id == KJS::HTMLElement::LabelFocus) {
             label.focus();
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(legendTag)) {
         HTMLLegendElementImpl &legend = static_cast<HTMLLegendElementImpl &>(element);
         if (id == KJS::HTMLElement::LegendFocus) {
             legend.focus();
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(textareaTag)) {
         HTMLTextAreaElementImpl &textarea = static_cast<HTMLTextAreaElementImpl &>(element);
         if (id == KJS::HTMLElement::TextAreaBlur) {
             textarea.blur();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::TextAreaFocus) {
             textarea.focus();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::TextAreaSelect) {
             textarea.select();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::TextAreaSetSelectionRange) {
             textarea.setSelectionRange(args[0]->toInt32(exec), args[1]->toInt32(exec));
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(aTag)) {
         HTMLAnchorElementImpl &anchor = static_cast<HTMLAnchorElementImpl &>(element);
         if (id == KJS::HTMLElement::AnchorBlur) {
             anchor.blur();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::AnchorFocus) {
             anchor.focus();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::AnchorToString)
-            return String(thisObj->toString(exec));
+            return jsString(thisObj->toString(exec));
     }
     else if (element.hasLocalName(tableTag)) {
         HTMLTableElementImpl &table = static_cast<HTMLTableElementImpl &>(element);
@@ -2455,25 +2455,25 @@ ValueImp *KJS::HTMLElementFunction::callAsFunction(ExecState *exec, ObjectImp *t
             return getDOMNode(exec,table.createTHead());
         else if (id == KJS::HTMLElement::TableDeleteTHead) {
             table.deleteTHead();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::TableCreateTFoot)
             return getDOMNode(exec,table.createTFoot());
         else if (id == KJS::HTMLElement::TableDeleteTFoot) {
             table.deleteTFoot();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::TableCreateCaption)
             return getDOMNode(exec,table.createCaption());
         else if (id == KJS::HTMLElement::TableDeleteCaption) {
             table.deleteCaption();
-            return Undefined();
+            return jsUndefined();
         }
         else if (id == KJS::HTMLElement::TableInsertRow)
             return getDOMNode(exec,table.insertRow(args[0]->toInt32(exec), exception));
         else if (id == KJS::HTMLElement::TableDeleteRow) {
             table.deleteRow(args[0]->toInt32(exec), exception);
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(theadTag) ||
@@ -2484,7 +2484,7 @@ ValueImp *KJS::HTMLElementFunction::callAsFunction(ExecState *exec, ObjectImp *t
             return getDOMNode(exec, tableSection.insertRow(args[0]->toInt32(exec), exception));
         else if (id == KJS::HTMLElement::TableSectionDeleteRow) {
             tableSection.deleteRow(args[0]->toInt32(exec), exception);
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(trTag)) {
@@ -2493,7 +2493,7 @@ ValueImp *KJS::HTMLElementFunction::callAsFunction(ExecState *exec, ObjectImp *t
             return getDOMNode(exec,tableRow.insertCell(args[0]->toInt32(exec), exception));
         else if (id == KJS::HTMLElement::TableRowDeleteCell) {
             tableRow.deleteCell(args[0]->toInt32(exec), exception);
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(marqueeTag)) {
@@ -2501,13 +2501,13 @@ ValueImp *KJS::HTMLElementFunction::callAsFunction(ExecState *exec, ObjectImp *t
             element.renderer()->layer() &&
             element.renderer()->layer()->marquee()) {
             element.renderer()->layer()->marquee()->start();
-            return Undefined();
+            return jsUndefined();
         }
         if (id == KJS::HTMLElement::MarqueeStop && element.renderer() && 
             element.renderer()->layer() &&
             element.renderer()->layer()->marquee()) {
             element.renderer()->layer()->marquee()->stop();
-            return Undefined();
+            return jsUndefined();
         }
     }
     else if (element.hasLocalName(canvasTag)) {
@@ -2515,11 +2515,11 @@ ValueImp *KJS::HTMLElementFunction::callAsFunction(ExecState *exec, ObjectImp *t
             if (args.size() == 0 || (args.size() == 1 && args[0]->toString(exec).qstring().lower() == "2d")) {
                 return new Context2D(&element);
             }
-            return Undefined();
+            return jsUndefined();
         }
     }
 
-    return Undefined();
+    return jsUndefined();
 }
 
 void KJS::HTMLElement::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
@@ -3323,7 +3323,7 @@ HTMLCollection::~HTMLCollection()
 ValueImp *HTMLCollection::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
     HTMLCollection *thisObj = static_cast<HTMLCollection *>(slot.slotBase());
-    return Number(thisObj->m_impl->length());
+    return jsNumber(thisObj->m_impl->length());
 }
 
 ValueImp *HTMLCollection::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -3402,7 +3402,7 @@ ValueImp *KJS::HTMLCollection::callAsFunction(ExecState *exec, ObjectImp *, cons
       }
     }
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 ValueImp *KJS::HTMLCollection::getNamedItems(ExecState *exec, const Identifier &propertyName) const
@@ -3418,7 +3418,7 @@ ValueImp *KJS::HTMLCollection::getNamedItems(ExecState *exec, const Identifier &
 #ifdef KJS_VERBOSE
     kdDebug(6070) << "not found" << endl;
 #endif
-    return Undefined();
+    return jsUndefined();
   }
 
   if (namedItems.count() == 1)
@@ -3441,7 +3441,7 @@ ValueImp *KJS::HTMLCollectionProtoFunc::callAsFunction(ExecState *exec, ObjectIm
   case KJS::HTMLCollection::NamedItem:
     return static_cast<HTMLCollection *>(thisObj)->getNamedItems(exec, Identifier(args[0]->toString(exec)));
   default:
-    return Undefined();
+    return jsUndefined();
   }
 }
 
@@ -3455,14 +3455,14 @@ HTMLSelectCollection::HTMLSelectCollection(ExecState *exec, HTMLCollectionImpl *
 ValueImp *HTMLSelectCollection::selectedIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
 {
     HTMLSelectCollection *thisObj = static_cast<HTMLSelectCollection *>(slot.slotBase());
-    return Number(thisObj->m_element->selectedIndex());
+    return jsNumber(thisObj->m_element->selectedIndex());
 }
 
 bool HTMLSelectCollection::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
 {
   if (propertyName == "selectedIndex") {
     slot.setCustom(this, selectedIndexGetter);
-    //result = Number(m_element->selectedIndex());
+    //result = jsNumber(m_element->selectedIndex());
     return true;
   }
 
@@ -3560,7 +3560,7 @@ OptionConstructorImp::OptionConstructorImp(ExecState *exec, DocumentImpl *d)
 
   // no. of arguments for constructor
   // ## is 4 correct ? 0 to 4, it seems to be
-  put(exec,lengthPropertyName, Number(4), ReadOnly|DontDelete|DontEnum);
+  put(exec,lengthPropertyName, jsNumber(4), ReadOnly|DontDelete|DontEnum);
 }
 
 bool OptionConstructorImp::implementsConstruct() const
@@ -3650,34 +3650,34 @@ ValueImp *Image::getValueProperty(ExecState *, int token) const
   case Src:
     return jsString(doc ? doc->completeURL(src.domString()) : src);
   case Complete:
-    return Boolean(!img || img->status() >= khtml::CachedObject::Persistent);
+    return jsBoolean(!img || img->status() >= khtml::CachedObject::Persistent);
   case OnLoad:
     if (onLoadListener && onLoadListener->listenerObjImp()) {
       return onLoadListener->listenerObj();
     } else {
-      return Null();
+      return jsNull();
     }
   case Width: {
     if (widthSet)
-        return Number(width);
+        return jsNumber(width);
     int w = 0;
     if (img) {
       QSize size = img->pixmap_size();
       if (size.isValid())
         w = size.width();
     }
-    return Number(w);
+    return jsNumber(w);
   }
   case Height: {
     if (heightSet)
-        return Number(height);
+        return jsNumber(height);
     int h = 0;
     if (img) {
       QSize size = img->pixmap_size();
       if (size.isValid())
         h = size.height();
     }
-    return Number(h);
+    return jsNumber(h);
   }
   default:
     kdWarning() << "Image::getValueProperty unhandled token " << token << endl;
@@ -3771,11 +3771,11 @@ ValueImp *KJS::Context2DFunction::callAsFunction(ExecState *exec, ObjectImp *thi
     Context2D *contextObject = static_cast<KJS::Context2D *>(thisObj);
     khtml::RenderCanvasImage *renderer = static_cast<khtml::RenderCanvasImage*>(contextObject->_element->renderer());
     if (!renderer)
-        return Undefined();
+        return jsUndefined();
 
     CGContextRef drawingContext = renderer->drawingContext();
     if (!drawingContext)
-        return Undefined();
+        return jsUndefined();
     
     switch (id) {
         case Context2D::Save: {
@@ -4284,7 +4284,7 @@ ValueImp *KJS::Context2DFunction::callAsFunction(ExecState *exec, ObjectImp *thi
                 }
                 else {
                     // No image.
-                    return Undefined();
+                    return jsUndefined();
                 }
                 w = pixmap.width();
                 h = pixmap.height();
@@ -4302,7 +4302,7 @@ ValueImp *KJS::Context2DFunction::callAsFunction(ExecState *exec, ObjectImp *thi
                 khtml::RenderCanvasImage *renderer = static_cast<khtml::RenderCanvasImage*>(e->renderer());
                 if (!renderer) {
                     // No renderer, nothing to draw.
-                    return Undefined();
+                    return jsUndefined();
                 }
 
                 sourceContext = renderer->drawingContext();
@@ -4472,7 +4472,7 @@ ValueImp *KJS::Context2DFunction::callAsFunction(ExecState *exec, ObjectImp *thi
         }
     }
 
-    return Undefined();
+    return jsUndefined();
 }
 
 const ClassInfo Context2D::info = { "Context2D", 0, &Context2DTable, 0 };
@@ -4590,7 +4590,7 @@ ValueImp *Context2D::getValueProperty(ExecState *, int token) const
         }
     }
     
-    return Undefined();
+    return jsUndefined();
 }
 
 void Context2D::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
@@ -4883,21 +4883,21 @@ Context2D::Context2D(HTMLElementImpl *e)
     _globalAlpha(jsUndefined()),
     _globalComposite(jsUndefined())
 {
-    _lineWidth = Number (1.);
-    _strokeStyle = String ("black");
-    _fillStyle = String ("black");
+    _lineWidth = jsNumber(1);
+    _strokeStyle = jsString("black");
+    _fillStyle = jsString("black");
     
-    _lineCap = String("butt");
-    _lineJoin = String("miter");
-    _miterLimit = Number(10.0);
+    _lineCap = jsString("butt");
+    _lineJoin = jsString("miter");
+    _miterLimit = jsNumber(10);
     
-    _shadowOffsetX = Number(0.);
-    _shadowOffsetY = Number(0.);
-    _shadowBlur = Number(0.);
-    _shadowColor = String("black");
+    _shadowOffsetX = jsNumber(0);
+    _shadowOffsetY = jsNumber(0);
+    _shadowBlur = jsNumber(0);
+    _shadowColor = jsString("black");
         
-    _globalAlpha = Number(1.);
-    _globalComposite = String("source-over");
+    _globalAlpha = jsNumber(1);
+    _globalComposite = jsString("source-over");
     
     stateStack.setAutoDelete(true);
 }
@@ -4995,7 +4995,7 @@ ValueImp *GradientFunction::callAsFunction(ExecState *exec, ObjectImp *thisObj,
         }
     }
 
-    return Undefined();
+    return jsUndefined();
 }
 
 void gradientCallback (void *info, const float *in, float *out)
@@ -5096,7 +5096,7 @@ bool Gradient::getOwnPropertySlot(ExecState *exec, const Identifier& propertyNam
 
 ValueImp *Gradient::getValueProperty(ExecState *, int token) const
 {
-    return Undefined();
+    return jsUndefined();
 }
 
 void Gradient::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
@@ -5292,7 +5292,7 @@ bool ImagePattern::getOwnPropertySlot(ExecState *exec, const Identifier& propert
 
 ValueImp *ImagePattern::getValueProperty(ExecState *, int token) const
 {
-    return Undefined();
+    return jsUndefined();
 }
 
 void ImagePattern::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
@@ -5316,7 +5316,7 @@ ValueImp *getSelectHTMLCollection(ExecState *exec, HTMLCollectionImpl *c, HTMLSe
 {
   DOMObject *ret;
   if (!c)
-    return Null();
+    return jsNull();
   ScriptInterpreter* interp = static_cast<ScriptInterpreter *>(exec->dynamicInterpreter());
   if ((ret = interp->getDOMObject(c)))
     return ret;
index eb1c6d5..bc2b6ea 100644 (file)
@@ -171,58 +171,58 @@ ValueImp *Navigator::getValueProperty(ExecState *exec, int token) const
   QString userAgent = KWQ(m_part)->userAgent();
   switch (token) {
   case AppCodeName:
-    return String("Mozilla");
+    return jsString("Mozilla");
   case AppName:
     // If we find "Mozilla" but not "(compatible, ...)" we are a real Netscape
     if (userAgent.find(QString::fromLatin1("Mozilla")) >= 0 &&
         userAgent.find(QString::fromLatin1("compatible")) == -1)
     {
       //kdDebug() << "appName -> Mozilla" << endl;
-      return String("Netscape");
+      return jsString("Netscape");
     }
     if (userAgent.find(QString::fromLatin1("Microsoft")) >= 0 ||
         userAgent.find(QString::fromLatin1("MSIE")) >= 0)
     {
       //kdDebug() << "appName -> IE" << endl;
-      return String("Microsoft Internet Explorer");
+      return jsString("Microsoft Internet Explorer");
     }
     // FIXME: Should we define a fallback result here besides "Konqueror"?
-    return Undefined();
+    return jsUndefined();
   case AppVersion:
     // We assume the string is something like Mozilla/version (properties)
-    return String(userAgent.mid(userAgent.find('/') + 1));
+    return jsString(userAgent.mid(userAgent.find('/') + 1));
   case Product:
     // When acting normal, we pretend to be "Gecko".
     if (userAgent.find("Mozilla/5.0") >= 0 && userAgent.find("compatible") == -1) {
-        return String("Gecko");
+        return jsString("Gecko");
     }
-    // When spoofing as IE, we use Undefined().
-    return Undefined();
+    // When spoofing as IE, we use jsUndefined().
+    return jsUndefined();
   case ProductSub:
-    return String("20030107");
+    return jsString("20030107");
   case Vendor:
-    return String("Apple Computer, Inc.");
+    return jsString("Apple Computer, Inc.");
   case Language:
     // We don't have an implementation of KGlobal::locale().  We do however
     // have a static method on KLocale to access the current language.
-    return String(KLocale::language());
+    return jsString(KLocale::language());
   case UserAgent:
-    return String(userAgent);
+    return jsString(userAgent);
   case Platform:
     // yet another evil hack, but necessary to spoof some sites...
     if ( (userAgent.find(QString::fromLatin1("Win"),0,false)>=0) )
-      return String(QString::fromLatin1("Win32"));
+      return jsString(QString::fromLatin1("Win32"));
     else if ( (userAgent.find(QString::fromLatin1("Macintosh"),0,false)>=0) ||
               (userAgent.find(QString::fromLatin1("Mac_PowerPC"),0,false)>=0) )
-      return String(QString::fromLatin1("MacPPC"));
+      return jsString(QString::fromLatin1("MacPPC"));
     else
-      return String(QString::fromLatin1("X11"));
+      return jsString(QString::fromLatin1("X11"));
   case _Plugins:
     return new Plugins(exec);
   case _MimeTypes:
     return new MimeTypes(exec);
   case CookieEnabled:
-    return Boolean(KWQKCookieJar::cookieEnabled());
+    return jsBoolean(KWQKCookieJar::cookieEnabled());
   default:
     kdWarning() << "Unhandled token in DOMEvent::getValueProperty : " << token << endl;
     return NULL;
@@ -334,7 +334,7 @@ IMPLEMENT_PROTOFUNC(PluginsFunc)
 ValueImp *Plugins::getValueProperty(ExecState *exec, int token) const
 {
   assert(token == Length);
-  return Number(plugins->count());
+  return jsNumber(plugins->count());
 }
 
 ValueImp *Plugins::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -349,7 +349,7 @@ ValueImp *Plugins::nameGetter(ExecState *exec, const Identifier& propertyName, c
       return new Plugin(exec, pl);
     }
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 bool Plugins::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -393,7 +393,7 @@ bool Plugins::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName
 ValueImp *MimeTypes::getValueProperty(ExecState *exec, int token) const
 {
   assert(token == Length);
-  return Number(plugins->count());
+  return jsNumber(plugins->count());
 }
 
 ValueImp *MimeTypes::indexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -407,7 +407,7 @@ ValueImp *MimeTypes::nameGetter(ExecState *exec, const Identifier& propertyName,
       if (m->type == propertyName.qstring())
           return new MimeType(exec, m);
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 bool MimeTypes::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
@@ -453,16 +453,16 @@ ValueImp *Plugin::getValueProperty(ExecState *exec, int token) const
 {
     switch (token) {
     case Name:
-        return String(m_info->name);
+        return jsString(m_info->name);
     case Filename:
-        return String(m_info->file);
+        return jsString(m_info->file);
     case Description:
-        return String(m_info->desc);
+        return jsString(m_info->desc);
     case Length: 
-        return Number(m_info->mimes.count());
+        return jsNumber(m_info->mimes.count());
     default:
         assert(0);
-        return Undefined();
+        return jsUndefined();
     }
 }
 
@@ -479,7 +479,7 @@ ValueImp *Plugin::nameGetter(ExecState *exec, const Identifier& propertyName, co
         if (m->type == propertyName.qstring())
             return new MimeType(exec, m);
     }
-    return Undefined();
+    return jsUndefined();
 }
 
 
@@ -525,15 +525,15 @@ ValueImp *MimeType::getValueProperty(ExecState *exec, int token) const
 {
     switch (token) {
     case Type:
-        return String(m_info->type);
+        return jsString(m_info->type);
     case Suffixes:
-        return String(m_info->suffixes);
+        return jsString(m_info->suffixes);
     case Description:
-        return String(m_info->desc);
+        return jsString(m_info->desc);
     case EnabledPlugin:
         return new Plugin(exec, m_info->plugin);
     default:
-        return Undefined();
+        return jsUndefined();
     }
 }
 
@@ -545,7 +545,7 @@ bool MimeType::getOwnPropertySlot(ExecState *exec, const Identifier& propertyNam
 ValueImp *PluginsFunc::callAsFunction(ExecState *exec, ObjectImp *, const List &args)
 {
     PluginBase(exec).refresh(args[0]->toBoolean(exec));
-    return Undefined();
+    return jsUndefined();
 }
 
 ValueImp *NavigatorFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &)
@@ -554,7 +554,7 @@ ValueImp *NavigatorFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, con
     return throwError(exec, TypeError);
   Navigator *nav = static_cast<Navigator *>(thisObj);
   // javaEnabled()
-  return Boolean(nav->part()->javaEnabled());
+  return jsBoolean(nav->part()->javaEnabled());
 }
 
 } // namespace
index 18c82d5..a4e128a 100644 (file)
@@ -246,7 +246,7 @@ public:
 ValueImp *TestFunctionImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
 {
   fprintf(stderr,"--> %s\n",args[0]->toString(exec).ascii());
-  return Undefined();
+  return jsUndefined();
 }
 
 void KJSProxyImpl::initScript()
index 0d0c31c..4a764e4 100644 (file)
@@ -101,9 +101,9 @@ ValueImp *DOMRange::getValueProperty(ExecState *exec, int token) const
   case EndContainer:
     return getDOMNode(exec, range.endContainer(exception));
   case EndOffset:
-    return Number(range.endOffset(exception));
+    return jsNumber(range.endOffset(exception));
   case Collapsed:
-    return Boolean(range.collapsed(exception));
+    return jsBoolean(range.collapsed(exception));
   case CommonAncestorContainer:
     return getDOMNode(exec, range.commonAncestorContainer(exception));
   default:
@@ -117,7 +117,7 @@ ValueImp *DOMRangeProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj,
   if (!thisObj->inherits(&KJS::DOMRange::info))
     return throwError(exec, TypeError);
   RangeImpl &range = *static_cast<DOMRange *>(thisObj)->impl();
-  ValueImp *result = Undefined();
+  ValueImp *result = jsUndefined();
   int exception = 0;
 
   switch (id) {
@@ -170,7 +170,7 @@ ValueImp *DOMRangeProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj,
       result = getDOMRange(exec, range.cloneRange(exception));
       break;
     case DOMRange::ToString:
-      result = getStringOrNull(range.toString(exception));
+      result = jsStringOrNull(range.toString(exception));
       break;
     case DOMRange::Detach:
       range.detach(exception);
@@ -207,7 +207,7 @@ bool RangeConstructor::getOwnPropertySlot(ExecState *exec, const Identifier& pro
 
 ValueImp *RangeConstructor::getValueProperty(ExecState *, int token) const
 {
-  return Number(token);
+  return jsNumber(token);
 }
 
 ValueImp *getRangeConstructor(ExecState *exec)
index 21218ef..8fa3750 100644 (file)
@@ -80,15 +80,15 @@ ValueImp *DOMNodeIterator::getValueProperty(ExecState *exec, int token) const
   case Root:
     return getDOMNode(exec,ni.root());
   case WhatToShow:
-    return Number(ni.whatToShow());
+    return jsNumber(ni.whatToShow());
   case Filter:
     return getDOMNodeFilter(exec,ni.filter());
   case ExpandEntityReferences:
-    return Boolean(ni.expandEntityReferences());
+    return jsBoolean(ni.expandEntityReferences());
   case ReferenceNode:
     return getDOMNode(exec,ni.referenceNode());
   case PointerBeforeReferenceNode:
-    return Boolean(ni.pointerBeforeReferenceNode());
+    return jsBoolean(ni.pointerBeforeReferenceNode());
  default:
    kdWarning() << "Unhandled token in DOMNodeIterator::getValueProperty : " << token << endl;
    return NULL;
@@ -108,9 +108,9 @@ ValueImp *DOMNodeIteratorProtoFunc::callAsFunction(ExecState *exec, ObjectImp *t
     return getDOMNode(exec,nodeIterator.nextNode(exception));
   case DOMNodeIterator::Detach:
     nodeIterator.detach(exception);
-    return Undefined();
+    return jsUndefined();
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 ValueImp *getDOMNodeIterator(ExecState *exec, NodeIteratorImpl *ni)
@@ -150,7 +150,7 @@ bool NodeFilterConstructor::getOwnPropertySlot(ExecState *exec, const Identifier
 ValueImp *NodeFilterConstructor::getValueProperty(ExecState *, int token) const
 {
   // We use the token as the value to return directly
-  return Number(token);
+  return jsNumber(token);
 }
 
 ValueImp *getNodeFilterConstructor(ExecState *exec)
@@ -188,9 +188,9 @@ ValueImp *DOMNodeFilterProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thi
   NodeFilterImpl &nodeFilter = *static_cast<DOMNodeFilter *>(thisObj)->impl();
   switch (id) {
     case DOMNodeFilter::AcceptNode:
-      return Number(nodeFilter.acceptNode(toNode(args[0])));
+      return jsNumber(nodeFilter.acceptNode(toNode(args[0])));
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 ValueImp *getDOMNodeFilter(ExecState *exec, NodeFilterImpl *nf)
@@ -253,11 +253,11 @@ ValueImp *DOMTreeWalker::getValueProperty(ExecState *exec, int token) const
   case Root:
     return getDOMNode(exec,tw.root());
   case WhatToShow:
-    return Number(tw.whatToShow());
+    return jsNumber(tw.whatToShow());
   case Filter:
     return getDOMNodeFilter(exec,tw.filter());
   case ExpandEntityReferences:
-    return Boolean(tw.expandEntityReferences());
+    return jsBoolean(tw.expandEntityReferences());
   case CurrentNode:
     return getDOMNode(exec,tw.currentNode());
   default:
@@ -298,7 +298,7 @@ ValueImp *DOMTreeWalkerProtoFunc::callAsFunction(ExecState *exec, ObjectImp *thi
     case DOMTreeWalker::NextNode:
       return getDOMNode(exec,treeWalker.nextNode());
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 ValueImp *getDOMTreeWalker(ExecState *exec, TreeWalkerImpl *tw)
index c207b93..d5a4be0 100644 (file)
@@ -86,7 +86,7 @@ ValueImp *DOMAbstractViewProtoFunc::callAsFunction(ExecState *exec, ObjectImp *t
     case DOMAbstractView::GetComputedStyle: {
         ElementImpl *arg0 = toElement(args[0]);
         if (!arg0)
-          return Undefined(); // throw exception?
+          return jsUndefined(); // throw exception?
         else {
           if (DocumentImpl* doc = arg0->getDocument())
             doc->updateLayoutIgnorePendingStylesheets();
@@ -96,7 +96,7 @@ ValueImp *DOMAbstractViewProtoFunc::callAsFunction(ExecState *exec, ObjectImp *t
     case DOMAbstractView::GetMatchedCSSRules: {
         ElementImpl *arg0 = toElement(args[0]);
         if (!arg0)
-            return Undefined(); // throw exception?
+            return jsUndefined(); // throw exception?
         else {
             // No need to update layout, since we just want the back-end rules.
             return getDOMCSSRuleList(exec, abstractView.getMatchedCSSRules(arg0,
@@ -104,7 +104,7 @@ ValueImp *DOMAbstractViewProtoFunc::callAsFunction(ExecState *exec, ObjectImp *t
         }
     }
   }
-  return Undefined();
+  return jsUndefined();
 }
 
 ValueImp *getDOMAbstractView(ExecState *exec, AbstractViewImpl *av)
index 07f8c74..2aa4886 100644 (file)
@@ -173,33 +173,33 @@ ValueImp *Screen::getValueProperty(ExecState *exec, int token) const
 
   switch( token ) {
   case Height:
-    return Number(sg.height());
+    return jsNumber(sg.height());
   case Width:
-    return Number(sg.width());
+    return jsNumber(sg.width());
   case ColorDepth:
   case PixelDepth: {
     QPaintDeviceMetrics m(QApplication::desktop());
-    return Number(m.depth());
+    return jsNumber(m.depth());
   }
   case AvailLeft: {
     QRect clipped = info.workArea().intersect(sg);
-    return Number(clipped.x()-sg.x());
+    return jsNumber(clipped.x()-sg.x());
   }
   case AvailTop: {
     QRect clipped = info.workArea().intersect(sg);
-    return Number(clipped.y()-sg.y());
+    return jsNumber(clipped.y()-sg.y());
   }
   case AvailHeight: {
     QRect clipped = info.workArea().intersect(sg);
-    return Number(clipped.height());
+    return jsNumber(clipped.height());
   }
   case AvailWidth: {
     QRect clipped = info.workArea().intersect(sg);
-    return Number(clipped.width());
+    return jsNumber(clipped.width());
   }
   default:
     kdWarning() << "Screen::getValueProperty unhandled token " << token << endl;
-    return Undefined();
+    return jsUndefined();
   }
 }
 
@@ -399,7 +399,7 @@ ValueImp *Window::retrieve(KHTMLPart *p)
 #endif
     return proxy->interpreter()->globalObject(); // the Global object is the "window"
   } else
-    return Undefined(); // This can happen with JS disabled on the domain of that window
+    return jsUndefined(); // This can happen with JS disabled on the domain of that window
 }
 
 Location *Window::location() const
@@ -621,7 +621,7 @@ static ValueImp *showModalDialog(ExecState *exec, Window *openerWindow, const Li
     UString URL = args[0]->toString(exec);
 
     if (!canShowModalDialogNow(openerWindow) || !allowPopUp(exec, openerWindow))
-        return Undefined();
+        return jsUndefined();
     
     const QMap<QString, QString> features = parseFeatures(exec, args[2]);
 
@@ -668,10 +668,10 @@ static ValueImp *showModalDialog(ExecState *exec, Window *openerWindow, const Li
 
     KHTMLPart *dialogPart = createNewWindow(exec, openerWindow, URL.qstring(), "", wargs, args[1]);
     if (!dialogPart)
-        return Undefined();
+        return jsUndefined();
 
     Window *dialogWindow = Window::retrieveWindow(dialogPart);
-    ValueImp *returnValue = Undefined();
+    ValueImp *returnValue = jsUndefined();
     dialogWindow->setReturnValueSlot(&returnValue);
     static_cast<KHTMLPartBrowserExtension *>(dialogPart->browserExtension())->runModal();
     dialogWindow->setReturnValueSlot(NULL);
@@ -684,13 +684,13 @@ ValueImp *Window::getValueProperty(ExecState *exec, int token) const
 
    switch (token) {
    case Closed:
-      return Boolean(m_part.isNull());
+      return jsBoolean(m_part.isNull());
    case Crypto:
-      return Undefined(); // ###
+      return jsUndefined(); // ###
    case DefaultStatus:
-      return String(UString(m_part->jsDefaultStatusBarText()));
+      return jsString(UString(m_part->jsDefaultStatusBarText()));
    case Status:
-      return String(UString(m_part->jsStatusBarText()));
+      return jsString(UString(m_part->jsStatusBarText()));
     case Node:
       return getNodeConstructor(exec);
     case Range:
@@ -713,22 +713,22 @@ ValueImp *Window::getValueProperty(ExecState *exec, int token) const
       return history;
     case Event:
       if (!m_evt)
-        return Undefined();
+        return jsUndefined();
       return getDOMEvent(exec, m_evt);
     case InnerHeight:
       if (!m_part->view())
-        return Undefined();
-      return Number(m_part->view()->visibleHeight());
+        return jsUndefined();
+      return jsNumber(m_part->view()->visibleHeight());
     case InnerWidth:
       if (!m_part->view())
-        return Undefined();
-      return Number(m_part->view()->visibleWidth());
+        return jsUndefined();
+      return jsNumber(m_part->view()->visibleWidth());
     case Length:
-      return Number(m_part->frames().count());
+      return jsNumber(m_part->frames().count());
     case _Location:
       return location();
     case Name:
-      return String(m_part->name());
+      return jsString(m_part->name());
     case _Navigator:
     case ClientInformation: {
       // Store the navigator in the object so we get the same one each time.
@@ -744,32 +744,32 @@ ValueImp *Window::getValueProperty(ExecState *exec, int token) const
     case Menubar:
       return menubar(exec);
     case OffscreenBuffering:
-      return Boolean(true);
+      return jsBoolean(true);
     case Opener:
       if (m_part->opener())
         return retrieve(m_part->opener());
       else
-        return Null();
+        return jsNull();
     case OuterHeight:
     case OuterWidth:
     {
       if (m_part->view()) {
         KWin::Info inf = KWin::info(m_part->view()->topLevelWidget()->winId());
-        return Number(token == OuterHeight ?
+        return jsNumber(token == OuterHeight ?
                       inf.geometry.height() : inf.geometry.width());
       } else
-        return Number(0);
+        return jsNumber(0);
     }
     case PageXOffset:
       if (!m_part->view())
-        return Undefined();
+        return jsUndefined();
       updateLayout();
-      return Number(m_part->view()->contentsX());
+      return jsNumber(m_part->view()->contentsX());
     case PageYOffset:
       if (!m_part->view())
-        return Undefined();
+        return jsUndefined();
       updateLayout();
-      return Number(m_part->view()->contentsY());
+      return jsNumber(m_part->view()->contentsY());
     case Parent:
       return retrieve(m_part->parentPart() ? m_part->parentPart() : (KHTMLPart*)m_part);
     case Personalbar:
@@ -781,28 +781,28 @@ ValueImp *Window::getValueProperty(ExecState *exec, int token) const
         // the windowFrame method of the WebKit's UI delegate. Also we don't want to try
         // to do anything relative to the screen the window is on, so the code below is no
         // good of us anyway.
-        return Number(m_part->view()->topLevelWidget()->frameGeometry().x());
+        return jsNumber(m_part->view()->topLevelWidget()->frameGeometry().x());
       } else
-        return Undefined();
+        return jsUndefined();
     }
     case ScreenTop:
     case ScreenY: {
       if (m_part->view()) {
         // See comment above in ScreenX.
-        return Number(m_part->view()->topLevelWidget()->frameGeometry().y());
+        return jsNumber(m_part->view()->topLevelWidget()->frameGeometry().y());
       } else 
-        return Undefined();
+        return jsUndefined();
     }
     case ScrollX:
       if (!m_part->view())
-        return Undefined();
+        return jsUndefined();
       updateLayout();
-      return Number(m_part->view()->contentsX());
+      return jsNumber(m_part->view()->contentsX());
     case ScrollY:
       if (!m_part->view())
-        return Undefined();
+        return jsUndefined();
       updateLayout();
-      return Number(m_part->view()->contentsY());
+      return jsNumber(m_part->view()->contentsY());
     case Scrollbars:
       return scrollbars(exec);
     case Statusbar:
@@ -839,7 +839,7 @@ ValueImp *Window::getValueProperty(ExecState *exec, int token) const
       return new XSLTProcessorConstructorImp(exec);
 #else
     case XSLTProcessor:
-      return Undefined();
+      return jsUndefined();
 #endif
     case FrameElement:
       if (DocumentImpl *doc = m_part->xmlDocImpl())
@@ -847,11 +847,11 @@ ValueImp *Window::getValueProperty(ExecState *exec, int token) const
           if (checkNodeSecurity(exec, fe)) {
             return getDOMNode(exec, fe);
           }
-      return Undefined();
+      return jsUndefined();
    }
 
    if (!isSafeScript(exec))
-     return Undefined();
+     return jsUndefined();
 
    switch (token) {
    case Document:
@@ -918,7 +918,7 @@ ValueImp *Window::getValueProperty(ExecState *exec, int token) const
      return getListener(exec,scrollEvent);
    }
    assert(0);
-   return Undefined();
+   return jsUndefined();
 }
 
 ValueImp *Window::childFrameGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
@@ -1370,16 +1370,16 @@ void Window::setListener(ExecState *exec, const AtomicString &eventType, ValueIm
 ValueImp *Window::getListener(ExecState *exec, const AtomicString &eventType) const
 {
   if (!isSafeScript(exec))
-    return Undefined();
+    return jsUndefined();
   DOM::DocumentImpl *doc = m_part->xmlDocImpl();
   if (!doc)
-    return Undefined();
+    return jsUndefined();
 
   DOM::EventListener *listener = doc->getHTMLWindowEventListener(eventType);
   if (listener && static_cast<JSEventListener*>(listener)->listenerObjImp())
     return static_cast<JSEventListener*>(listener)->listenerObj();
   else
-    return Null();
+    return jsNull();
 }
 
 JSEventListener *Window::getJSEventListener(ValueImp *val, bool html)
@@ -1450,7 +1450,7 @@ ValueImp *WindowFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const
 
   KHTMLPart *part = window->m_part;
   if (!part)
-    return Undefined();
+    return jsUndefined();
 
   KHTMLView *widget = part->view();
   ValueImp *v = args[0];
@@ -1462,20 +1462,20 @@ ValueImp *WindowFunc::callAsFunction(ExecState *exec, ObjectImp *thisObj, const
     if (part && part->xmlDocImpl())
       part->xmlDocImpl()->updateRendering();
     KWQ(part)->runJavaScriptAlert(str);
-    return Undefined();
+    return jsUndefined();
   case Window::Confirm:
     if (part && part->xmlDocImpl())
       part->xmlDocImpl()->updateRendering();
-    return Boolean(KWQ(part)->runJavaScriptConfirm(str));
+    return jsBoolean(KWQ(part)->runJavaScriptConfirm(str));
   case Window::Prompt:
     if (part && part->xmlDocImpl())
       part->xmlDocImpl()->updateRendering();
     bool ok;
     ok = KWQ(part)->runJavaScriptPrompt(str, args.size() >= 2 ? args[1]->toString(exec).qstring() : QString::null, str2);
     if ( ok )
-        return String(str2);
+