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/string_object.cpp

    r11077 r11525  
    4444  : ObjectImp(proto)
    4545{
    46   setInternalValue(String(""));
     46  setInternalValue(jsString(""));
    4747}
    4848
     
    5050  : ObjectImp(proto)
    5151{
    52   setInternalValue(String(string));
     52  setInternalValue(jsString(string));
    5353}
    5454
     
    146146{
    147147  // The constructor will be added later, after StringObjectImp has been built
    148   putDirect(lengthPropertyName, jsZero(), DontDelete|ReadOnly|DontEnum);
     148  putDirect(lengthPropertyName, jsNumber(0), DontDelete|ReadOnly|DontEnum);
    149149}
    150150
     
    339339    delete [] replacements;
    340340
    341     return String(result);
     341    return jsString(result);
    342342  }
    343343 
     
    348348  // Do the replacement
    349349  if (matchPos == -1)
    350     return String(source);
     350    return jsString(source);
    351351 
    352352  if (replacementFunction) {
     
    361361  }
    362362
    363   return String(source.substr(0, matchPos) + replacementString + source.substr(matchPos + matchLen));
     363  return jsString(source.substr(0, matchPos) + replacementString + source.substr(matchPos + matchLen));
    364364}
    365365
     
    374374      return throwError(exec, TypeError);
    375375
    376     return String(thisObj->internalValue()->toString(exec));
     376    return jsString(thisObj->internalValue()->toString(exec));
    377377  }
    378378
     
    401401    else
    402402      u = "";
    403     result = String(u);
     403    result = jsString(u);
    404404    break;
    405405  case CharCodeAt:
     
    408408    dpos = a0->isUndefined() ? 0 : a0->toInteger(exec);
    409409    if (dpos >= 0 && dpos < len) // false for NaN
    410       result = Number(s[static_cast<int>(dpos)].unicode());
     410      result = jsNumber(s[static_cast<int>(dpos)].unicode());
    411411    else
    412412      result = jsNaN();
     
    417417        s += it->toString(exec);
    418418    }
    419     result = String(s);
     419    result = jsString(s);
    420420    break;
    421421  }
     
    432432        dpos = 0;
    433433    }
    434     result = Number(s.find(u2, static_cast<int>(dpos)));
     434    result = jsNumber(s.find(u2, static_cast<int>(dpos)));
    435435    break;
    436436  case LastIndexOf:
     
    447447        dpos = 0;
    448448    }
    449     result = Number(s.rfind(u2, static_cast<int>(dpos)));
     449    result = jsNumber(s.rfind(u2, static_cast<int>(dpos)));
    450450    break;
    451451  case Match:
     
    468468    UString mstr = regExpObj->performMatch(reg, u, 0, &pos);
    469469    if (id == Search) {
    470       result = Number(pos);
     470      result = jsNumber(pos);
    471471    } else {
    472472      // Exec
     
    474474        // case without 'g' flag is handled like RegExp.prototype.exec
    475475        if (mstr.isNull()) {
    476           result = Null();
     476          result = jsNull();
    477477        } else {
    478478          result = regExpObj->arrayOfMatches(exec,mstr);
     
    486486            list.append(jsUndefined());
    487487          else
    488             list.append(String(mstr));
     488            list.append(jsString(mstr));
    489489          lastIndex = pos;
    490490          pos += mstr.isEmpty() ? 1 : mstr.size();
     
    492492        }
    493493        if (imp)
    494           imp->put(exec, "lastIndex", Number(lastIndex), DontDelete|DontEnum);
     494          imp->put(exec, "lastIndex", jsNumber(lastIndex), DontDelete|DontEnum);
    495495        if (list.isEmpty()) {
    496496          // if there are no matches at all, it's important to return
    497497          // Null instead of an empty array, because this matches
    498498          // other browsers and because Null is a false value.
    499           result = Null();
     499          result = jsNull();
    500500        } else {
    501501          result = exec->lexicalInterpreter()->builtinArray()->construct(exec, list);
     
    521521        if (to > len)
    522522          to = len;
    523         result = String(s.substr(static_cast<int>(from), static_cast<int>(to - from)));
     523        result = jsString(s.substr(static_cast<int>(from), static_cast<int>(to - from)));
    524524      } else {
    525         result = String("");
     525        result = jsString("");
    526526      }
    527527      break;
     
    539539      if (u.isEmpty() && !reg.match(u, 0).isNull()) {
    540540        // empty string matched by regexp -> empty array
    541         res->put(exec,lengthPropertyName, Number(0));
     541        res->put(exec,lengthPropertyName, jsNumber(0));
    542542        break;
    543543      }
     
    553553        pos = mpos + (mstr.isEmpty() ? 1 : mstr.size());
    554554        if (mpos != p0 || !mstr.isEmpty()) {
    555           res->put(exec,i, String(u.substr(p0, mpos-p0)));
     555          res->put(exec,i, jsString(u.substr(p0, mpos-p0)));
    556556          p0 = mpos + mstr.size();
    557557          i++;
     
    563563        if (u.isEmpty()) {
    564564          // empty separator matches empty string -> empty array
    565           put(exec,lengthPropertyName, Number(0));
     565          put(exec,lengthPropertyName, jsNumber(0));
    566566          break;
    567567        } else {
    568568          while (static_cast<uint32_t>(i) != limit && i < u.size()-1)
    569             res->put(exec, i++, String(u.substr(p0++, 1)));
     569            res->put(exec, i++, jsString(u.substr(p0++, 1)));
    570570        }
    571571      } else {
    572572        while (static_cast<uint32_t>(i) != limit && (pos = u.find(u2, p0)) >= 0) {
    573           res->put(exec, i, String(u.substr(p0, pos-p0)));
     573          res->put(exec, i, jsString(u.substr(p0, pos-p0)));
    574574          p0 = pos + u2.size();
    575575          i++;
     
    579579    // add remaining string, if any
    580580    if (static_cast<uint32_t>(i) != limit)
    581       res->put(exec, i++, String(u.substr(p0)));
    582     res->put(exec,lengthPropertyName, Number(i));
     581      res->put(exec, i++, jsString(u.substr(p0)));
     582    res->put(exec,lengthPropertyName, jsNumber(i));
    583583    }
    584584    break;
     
    599599        d2 = len - d;
    600600    }
    601     result = String(s.substr(static_cast<int>(d), static_cast<int>(d2)));
     601    result = jsString(s.substr(static_cast<int>(d), static_cast<int>(d2)));
    602602    break;
    603603  }
     
    624624      start = temp;
    625625    }
    626     result = String(s.substr((int)start, (int)end-(int)start));
     626    result = jsString(s.substr((int)start, (int)end-(int)start));
    627627    }
    628628    break;
     
    632632    for (i = 0; i < len; i++)
    633633      u[i] = u[i].toLower();
    634     result = String(u);
     634    result = jsString(u);
    635635    break;
    636636  case ToUpperCase:
     
    639639    for (i = 0; i < len; i++)
    640640      u[i] = u[i].toUpper();
    641     result = String(u);
     641    result = jsString(u);
    642642    break;
    643643#ifndef KJS_PURE_ECMA
    644644  case Big:
    645     result = String("<big>" + s + "</big>");
     645    result = jsString("<big>" + s + "</big>");
    646646    break;
    647647  case Small:
    648     result = String("<small>" + s + "</small>");
     648    result = jsString("<small>" + s + "</small>");
    649649    break;
    650650  case Blink:
    651     result = String("<blink>" + s + "</blink>");
     651    result = jsString("<blink>" + s + "</blink>");
    652652    break;
    653653  case Bold:
    654     result = String("<b>" + s + "</b>");
     654    result = jsString("<b>" + s + "</b>");
    655655    break;
    656656  case Fixed:
    657     result = String("<tt>" + s + "</tt>");
     657    result = jsString("<tt>" + s + "</tt>");
    658658    break;
    659659  case Italics:
    660     result = String("<i>" + s + "</i>");
     660    result = jsString("<i>" + s + "</i>");
    661661    break;
    662662  case Strike:
    663     result = String("<strike>" + s + "</strike>");
     663    result = jsString("<strike>" + s + "</strike>");
    664664    break;
    665665  case Sub:
    666     result = String("<sub>" + s + "</sub>");
     666    result = jsString("<sub>" + s + "</sub>");
    667667    break;
    668668  case Sup:
    669     result = String("<sup>" + s + "</sup>");
     669    result = jsString("<sup>" + s + "</sup>");
    670670    break;
    671671  case Fontcolor:
    672     result = String("<font color=\"" + a0->toString(exec) + "\">" + s + "</font>");
     672    result = jsString("<font color=\"" + a0->toString(exec) + "\">" + s + "</font>");
    673673    break;
    674674  case Fontsize:
    675     result = String("<font size=\"" + a0->toString(exec) + "\">" + s + "</font>");
     675    result = jsString("<font size=\"" + a0->toString(exec) + "\">" + s + "</font>");
    676676    break;
    677677  case Anchor:
    678     result = String("<a name=\"" + a0->toString(exec) + "\">" + s + "</a>");
     678    result = jsString("<a name=\"" + a0->toString(exec) + "\">" + s + "</a>");
    679679    break;
    680680  case Link:
    681     result = String("<a href=\"" + a0->toString(exec) + "\">" + s + "</a>");
     681    result = jsString("<a href=\"" + a0->toString(exec) + "\">" + s + "</a>");
    682682    break;
    683683#endif
     
    700700
    701701  // no. of arguments for constructor
    702   putDirect(lengthPropertyName, jsOne(), ReadOnly|DontDelete|DontEnum);
     702  putDirect(lengthPropertyName, jsNumber(1), ReadOnly|DontDelete|DontEnum);
    703703}
    704704
     
    727727{
    728728  if (args.isEmpty())
    729     return String("");
     729    return jsString("");
    730730  else {
    731731    ValueImp *v = args[0];
    732     return String(v->toString(exec));
     732    return jsString(v->toString(exec));
    733733  }
    734734}
     
    740740  : InternalFunctionImp(funcProto)
    741741{
    742   putDirect(lengthPropertyName, jsOne(), DontDelete|ReadOnly|DontEnum);
     742  putDirect(lengthPropertyName, jsNumber(1), DontDelete|ReadOnly|DontEnum);
    743743}
    744744
     
    764764    s = "";
    765765
    766   return String(s);
    767 }
     766  return jsString(s);
     767}
Note: See TracChangeset for help on using the changeset viewer.