Ignore:
Timestamp:
Dec 10, 2005, 4:38:07 PM (19 years ago)
Author:
darin
Message:

JavaScriptCore:

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:]):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/function.cpp

    r11375 r11525  
    101101    if (!cont) {
    102102      dbg->imp()->abort();
    103       return Undefined();
     103      return jsUndefined();
    104104    }
    105105  }
     
    130130    if (!cont) {
    131131      dbg->imp()->abort();
    132       return Undefined();
     132      return jsUndefined();
    133133    }
    134134  }
     
    141141    return comp.value();
    142142  else
    143     return Undefined();
     143    return jsUndefined();
    144144}
    145145
     
    191191        it++;
    192192      } else
    193         variable->put(exec, p->name, Undefined());
     193        variable->put(exec, p->name, jsUndefined());
    194194      p = p->next;
    195195    }
     
    217217    context = context->callingContext();
    218218  }
    219   return Null();
     219  return jsNull();
    220220}
    221221
     
    229229    p = p->next;
    230230  }
    231   return Number(count);
     231  return jsNumber(count);
    232232}
    233233
     
    338338  if (result.complType() == Throw || result.complType() == ReturnValue)
    339339      return result;
    340   return Completion(Normal, Undefined()); // TODO: or ReturnValue ?
     340  return Completion(Normal, jsUndefined()); // TODO: or ReturnValue ?
    341341}
    342342
     
    576576    }
    577577  }
    578   return String(r);
     578  return jsString(r);
    579579}
    580580
     
    641641    s.append(c);
    642642  }
    643   return String(s);
     643  return jsString(s);
    644644}
    645645
     
    788788          bool cont = dbg->sourceParsed(exec, sid, UString(), s, errLine);
    789789          if (!cont)
    790             return Undefined();
     790            return jsUndefined();
    791791        }
    792792
     
    815815          exec->setException(newExec.exception());
    816816
    817         res = Undefined();
     817        res = jsUndefined();
    818818        if (c.complType() == Throw)
    819819          exec->setException(c.value());
     
    824824    }
    825825  case ParseInt:
    826     res = Number(parseInt(args[0]->toString(exec), args[1]->toInt32(exec)));
     826    res = jsNumber(parseInt(args[0]->toString(exec), args[1]->toInt32(exec)));
    827827    break;
    828828  case ParseFloat:
    829     res = Number(parseFloat(args[0]->toString(exec)));
     829    res = jsNumber(parseFloat(args[0]->toString(exec)));
    830830    break;
    831831  case IsNaN:
    832     res = Boolean(isNaN(args[0]->toNumber(exec)));
     832    res = jsBoolean(isNaN(args[0]->toNumber(exec)));
    833833    break;
    834834  case IsFinite: {
    835835    double n = args[0]->toNumber(exec);
    836     res = Boolean(!isNaN(n) && !isInf(n));
     836    res = jsBoolean(!isNaN(n) && !isInf(n));
    837837    break;
    838838  }
     
    868868        r += s;
    869869      }
    870       res = String(r);
     870      res = jsString(r);
    871871      break;
    872872    }
     
    895895        s += UString(c, 1);
    896896      }
    897       res = String(s);
     897      res = jsString(s);
    898898      break;
    899899    }
Note: See TracChangeset for help on using the changeset viewer.