source: webkit/trunk/JavaScriptCore/kjs/value.h@ 10456

Last change on this file since 10456 was 10084, checked in by darin, 20 years ago

JavaScriptCore:

Rubber stamped by Maciej.

Global replaces and other wonderful stuff.

  • bindings/NP_jsobject.cpp: (_NPN_Invoke): (_NPN_Evaluate): (_NPN_GetProperty): (_NPN_SetProperty): (_NPN_HasMethod): (_NPN_SetException):
  • bindings/c/c_instance.cpp: (KJS::Bindings::CInstance::CInstance): (KJS::Bindings::CInstance::invokeMethod): (KJS::Bindings::CInstance::invokeDefaultMethod): (KJS::Bindings::CInstance::defaultValue): (KJS::Bindings::CInstance::stringValue): (KJS::Bindings::CInstance::numberValue): (KJS::Bindings::CInstance::booleanValue): (KJS::Bindings::CInstance::valueOf):
  • bindings/c/c_instance.h:
  • bindings/c/c_runtime.cpp: (CField::valueFromInstance): (CField::setValueToInstance):
  • bindings/c/c_runtime.h:
  • bindings/c/c_utility.cpp: (convertNPStringToUTF16): (convertUTF8ToUTF16): (coerceValueToNPVariantStringType): (convertValueToNPVariant): (convertNPVariantToValue):
  • bindings/c/c_utility.h:
  • bindings/jni/jni_instance.cpp: (JavaInstance::stringValue): (JavaInstance::numberValue): (JavaInstance::booleanValue): (JavaInstance::invokeMethod): (JavaInstance::invokeDefaultMethod): (JavaInstance::defaultValue): (JavaInstance::valueOf):
  • bindings/jni/jni_instance.h:
  • bindings/jni/jni_jsobject.cpp: (JSObject::invoke): (JSObject::call): (JSObject::eval): (JSObject::getMember): (JSObject::getSlot): (JSObject::toString): (JSObject::convertValueToJObject): (JSObject::convertJObjectToValue): (JSObject::listFromJArray):
  • bindings/jni/jni_jsobject.h:
  • bindings/jni/jni_objc.mm: (KJS::Bindings::dispatchJNICall):
  • bindings/jni/jni_runtime.cpp: (JavaArray::convertJObjectToArray): (JavaField::dispatchValueFromInstance): (JavaField::valueFromInstance): (JavaField::dispatchSetValueToInstance): (JavaField::setValueToInstance): (JavaArray::setValueAt): (JavaArray::valueAt):
  • bindings/jni/jni_runtime.h: (KJS::Bindings::JavaString::ustring):
  • bindings/jni/jni_utility.cpp: (KJS::Bindings::getJavaVM): (KJS::Bindings::getJNIEnv): (KJS::Bindings::getMethodID): (KJS::Bindings::callJNIVoidMethod): (KJS::Bindings::callJNIObjectMethod): (KJS::Bindings::callJNIBooleanMethod): (KJS::Bindings::callJNIStaticBooleanMethod): (KJS::Bindings::callJNIByteMethod): (KJS::Bindings::callJNICharMethod): (KJS::Bindings::callJNIShortMethod): (KJS::Bindings::callJNIIntMethod): (KJS::Bindings::callJNILongMethod): (KJS::Bindings::callJNIFloatMethod): (KJS::Bindings::callJNIDoubleMethod): (KJS::Bindings::callJNIVoidMethodA): (KJS::Bindings::callJNIObjectMethodA): (KJS::Bindings::callJNIByteMethodA): (KJS::Bindings::callJNICharMethodA): (KJS::Bindings::callJNIShortMethodA): (KJS::Bindings::callJNIIntMethodA): (KJS::Bindings::callJNILongMethodA): (KJS::Bindings::callJNIFloatMethodA): (KJS::Bindings::callJNIDoubleMethodA): (KJS::Bindings::callJNIBooleanMethodA): (KJS::Bindings::callJNIVoidMethodIDA): (KJS::Bindings::callJNIObjectMethodIDA): (KJS::Bindings::callJNIByteMethodIDA): (KJS::Bindings::callJNICharMethodIDA): (KJS::Bindings::callJNIShortMethodIDA): (KJS::Bindings::callJNIIntMethodIDA): (KJS::Bindings::callJNILongMethodIDA): (KJS::Bindings::callJNIFloatMethodIDA): (KJS::Bindings::callJNIDoubleMethodIDA): (KJS::Bindings::callJNIBooleanMethodIDA): (KJS::Bindings::getCharactersFromJString): (KJS::Bindings::releaseCharactersForJString): (KJS::Bindings::getCharactersFromJStringInEnv): (KJS::Bindings::releaseCharactersForJStringInEnv): (KJS::Bindings::getUCharactersFromJStringInEnv): (KJS::Bindings::releaseUCharactersForJStringInEnv): (KJS::Bindings::JNITypeFromClassName): (KJS::Bindings::signatureFromPrimitiveType): (KJS::Bindings::JNITypeFromPrimitiveType): (KJS::Bindings::getJNIField): (KJS::Bindings::convertValueToJValue):
  • bindings/jni/jni_utility.h:
  • bindings/objc/WebScriptObject.mm: (_didExecute): (-[WebScriptObject _initializeWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]): (-[WebScriptObject _initWithObjectImp:originExecutionContext:Bindings::executionContext:Bindings::]): (-[WebScriptObject _imp]): (-[WebScriptObject _executionContext]): (-[WebScriptObject _setExecutionContext:]): (-[WebScriptObject _originExecutionContext]): (-[WebScriptObject _setOriginExecutionContext:]): (+[WebScriptObject throwException:]): (listFromNSArray): (-[WebScriptObject callWebScriptMethod:withArguments:]): (-[WebScriptObject evaluateWebScript:]): (-[WebScriptObject setValue:forKey:]): (-[WebScriptObject valueForKey:]): (-[WebScriptObject removeWebScriptKey:]): (-[WebScriptObject stringRepresentation]): (-[WebScriptObject webScriptValueAtIndex:]): (-[WebScriptObject setException:]): (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:Bindings::]):
  • bindings/objc/WebScriptObjectPrivate.h:
  • bindings/objc/objc_class.h:
  • bindings/objc/objc_class.mm: (KJS::Bindings::ObjcClass::fallbackObject):
  • bindings/objc/objc_instance.h:
  • bindings/objc/objc_instance.mm: (ObjcInstance::invokeMethod): (ObjcInstance::invokeDefaultMethod): (ObjcInstance::setValueOfField): (ObjcInstance::setValueOfUndefinedField): (ObjcInstance::getValueOfField): (ObjcInstance::getValueOfUndefinedField): (ObjcInstance::defaultValue): (ObjcInstance::stringValue): (ObjcInstance::numberValue): (ObjcInstance::booleanValue): (ObjcInstance::valueOf):
  • bindings/objc/objc_runtime.h:
  • bindings/objc/objc_runtime.mm: (ObjcField::valueFromInstance): (convertValueToObjcObject): (ObjcField::setValueToInstance): (ObjcArray::setValueAt): (ObjcArray::valueAt): (ObjcFallbackObjectImp::put): (ObjcFallbackObjectImp::callAsFunction): (ObjcFallbackObjectImp::defaultValue):
  • bindings/objc/objc_utility.h:
  • bindings/objc/objc_utility.mm: (Bindings::JSMethodNameToObjCMethodName): (Bindings::convertValueToObjcValue): (Bindings::convertNSStringToString): (Bindings::convertObjcValueToValue): (Bindings::objcValueTypeForType): (Bindings::createObjcInstanceForValue):
  • bindings/runtime.cpp: (Instance::getValueOfField): (Instance::setValueOfField): (Instance::createRuntimeObject): (Instance::createLanguageInstanceForValue):
  • bindings/runtime.h: (KJS::Bindings::Constructor::~Constructor): (KJS::Bindings::Field::~Field): (KJS::Bindings::MethodList::MethodList): (KJS::Bindings::Class::fallbackObject): (KJS::Bindings::Class::~Class): (KJS::Bindings::Instance::Instance): (KJS::Bindings::Instance::getValueOfUndefinedField): (KJS::Bindings::Instance::supportsSetValueOfUndefinedField): (KJS::Bindings::Instance::setValueOfUndefinedField): (KJS::Bindings::Instance::valueOf): (KJS::Bindings::Instance::setExecutionContext): (KJS::Bindings::Instance::~Instance): (KJS::Bindings::Array::~Array):
  • bindings/runtime_array.cpp: (RuntimeArrayImp::RuntimeArrayImp): (RuntimeArrayImp::lengthGetter): (RuntimeArrayImp::indexGetter): (RuntimeArrayImp::put):
  • bindings/runtime_array.h:
  • bindings/runtime_method.cpp: (RuntimeMethodImp::lengthGetter): (RuntimeMethodImp::callAsFunction):
  • bindings/runtime_method.h:
  • bindings/runtime_object.cpp: (RuntimeObjectImp::fallbackObjectGetter): (RuntimeObjectImp::fieldGetter): (RuntimeObjectImp::methodGetter): (RuntimeObjectImp::getOwnPropertySlot): (RuntimeObjectImp::put): (RuntimeObjectImp::defaultValue): (RuntimeObjectImp::callAsFunction):
  • bindings/runtime_object.h:
  • kjs/array_instance.h:
  • kjs/array_object.cpp: (ArrayInstanceImp::ArrayInstanceImp): (ArrayInstanceImp::lengthGetter): (ArrayInstanceImp::getOwnPropertySlot): (ArrayInstanceImp::put): (ArrayInstanceImp::propList): (ArrayInstanceImp::setLength): (compareByStringForQSort): (compareWithCompareFunctionForQSort): (ArrayInstanceImp::sort): (ArrayInstanceImp::pushUndefinedObjectsToEnd): (ArrayPrototypeImp::ArrayPrototypeImp): (ArrayProtoFuncImp::ArrayProtoFuncImp): (ArrayProtoFuncImp::callAsFunction): (ArrayObjectImp::ArrayObjectImp): (ArrayObjectImp::construct): (ArrayObjectImp::callAsFunction):
  • kjs/array_object.h:
  • kjs/bool_object.cpp: (BooleanPrototypeImp::BooleanPrototypeImp): (BooleanProtoFuncImp::BooleanProtoFuncImp): (BooleanProtoFuncImp::callAsFunction): (BooleanObjectImp::BooleanObjectImp): (BooleanObjectImp::construct): (BooleanObjectImp::callAsFunction):
  • kjs/bool_object.h:
  • kjs/collector.cpp: (KJS::Collector::markStackObjectsConservatively): (KJS::Collector::collect): (KJS::className):
  • kjs/completion.h: (KJS::Completion::Completion): (KJS::Completion::value): (KJS::Completion::isValueCompletion):
  • kjs/context.h: (KJS::ContextImp::variableObject): (KJS::ContextImp::setVariableObject): (KJS::ContextImp::thisValue): (KJS::ContextImp::activationObject): (KJS::ContextImp::pushScope):
  • kjs/date_object.cpp: (formatLocaleDate): (KJS::timeFromArgs): (KJS::DatePrototypeImp::DatePrototypeImp): (KJS::DateProtoFuncImp::DateProtoFuncImp): (KJS::DateProtoFuncImp::callAsFunction): (KJS::DateObjectImp::DateObjectImp): (KJS::DateObjectImp::construct): (KJS::DateObjectImp::callAsFunction): (KJS::DateObjectFuncImp::DateObjectFuncImp): (KJS::DateObjectFuncImp::callAsFunction): (KJS::parseDate): (KJS::KRFCDate_parseDate): (KJS::timeClip):
  • kjs/date_object.h:
  • kjs/debugger.cpp: (Debugger::exception): (Debugger::callEvent): (Debugger::returnEvent):
  • kjs/debugger.h:
  • kjs/error_object.cpp: (ErrorPrototypeImp::ErrorPrototypeImp): (ErrorProtoFuncImp::ErrorProtoFuncImp): (ErrorProtoFuncImp::callAsFunction): (ErrorObjectImp::ErrorObjectImp): (ErrorObjectImp::construct): (ErrorObjectImp::callAsFunction): (NativeErrorPrototypeImp::NativeErrorPrototypeImp): (NativeErrorImp::NativeErrorImp): (NativeErrorImp::construct): (NativeErrorImp::callAsFunction):
  • kjs/error_object.h:
  • kjs/function.cpp: (KJS::FunctionImp::FunctionImp): (KJS::FunctionImp::callAsFunction): (KJS::FunctionImp::processParameters): (KJS::FunctionImp::argumentsGetter): (KJS::FunctionImp::lengthGetter): (KJS::FunctionImp::put): (KJS::DeclaredFunctionImp::DeclaredFunctionImp): (KJS::DeclaredFunctionImp::construct): (KJS::ArgumentsImp::ArgumentsImp): (KJS::ArgumentsImp::mappedIndexGetter): (KJS::ArgumentsImp::put): (KJS::ActivationImp::argumentsGetter): (KJS::GlobalFuncImp::GlobalFuncImp): (KJS::encode): (KJS::decode): (KJS::GlobalFuncImp::callAsFunction):
  • kjs/function.h:
  • kjs/function_object.cpp: (FunctionPrototypeImp::FunctionPrototypeImp): (FunctionPrototypeImp::callAsFunction): (FunctionProtoFuncImp::FunctionProtoFuncImp): (FunctionProtoFuncImp::callAsFunction): (FunctionObjectImp::FunctionObjectImp): (FunctionObjectImp::construct): (FunctionObjectImp::callAsFunction):
  • kjs/function_object.h:
  • kjs/internal.cpp: (KJS::UndefinedImp::toPrimitive): (KJS::UndefinedImp::toObject): (KJS::NullImp::toPrimitive): (KJS::NullImp::toObject): (KJS::BooleanImp::toPrimitive): (KJS::BooleanImp::toObject): (KJS::StringImp::toPrimitive): (KJS::StringImp::toObject): (KJS::NumberImp::toPrimitive): (KJS::NumberImp::toObject): (KJS::NumberImp::getUInt32): (KJS::LabelStack::push): (KJS::ContextImp::ContextImp): (KJS::InterpreterImp::globalInit): (KJS::InterpreterImp::globalClear): (KJS::InterpreterImp::InterpreterImp): (KJS::InterpreterImp::initGlobalObject): (KJS::InterpreterImp::clear): (KJS::InterpreterImp::mark): (KJS::InterpreterImp::evaluate): (KJS::InternalFunctionImp::hasInstance): (KJS::roundValue): (KJS::printInfo):
  • kjs/internal.h: (KJS::InterpreterImp::builtinObject): (KJS::InterpreterImp::builtinFunction): (KJS::InterpreterImp::builtinArray): (KJS::InterpreterImp::builtinBoolean): (KJS::InterpreterImp::builtinString): (KJS::InterpreterImp::builtinNumber): (KJS::InterpreterImp::builtinDate): (KJS::InterpreterImp::builtinRegExp): (KJS::InterpreterImp::builtinError): (KJS::InterpreterImp::builtinObjectPrototype): (KJS::InterpreterImp::builtinFunctionPrototype): (KJS::InterpreterImp::builtinArrayPrototype): (KJS::InterpreterImp::builtinBooleanPrototype): (KJS::InterpreterImp::builtinStringPrototype): (KJS::InterpreterImp::builtinNumberPrototype): (KJS::InterpreterImp::builtinDatePrototype): (KJS::InterpreterImp::builtinRegExpPrototype): (KJS::InterpreterImp::builtinErrorPrototype): (KJS::InterpreterImp::builtinEvalError): (KJS::InterpreterImp::builtinRangeError): (KJS::InterpreterImp::builtinReferenceError): (KJS::InterpreterImp::builtinSyntaxError): (KJS::InterpreterImp::builtinTypeError): (KJS::InterpreterImp::builtinURIError): (KJS::InterpreterImp::builtinEvalErrorPrototype): (KJS::InterpreterImp::builtinRangeErrorPrototype): (KJS::InterpreterImp::builtinReferenceErrorPrototype): (KJS::InterpreterImp::builtinSyntaxErrorPrototype): (KJS::InterpreterImp::builtinTypeErrorPrototype): (KJS::InterpreterImp::builtinURIErrorPrototype):
  • kjs/interpreter.cpp: (Context::variableObject): (Context::thisValue): (Interpreter::Interpreter): (Interpreter::globalObject): (Interpreter::evaluate): (Interpreter::builtinObject): (Interpreter::builtinFunction): (Interpreter::builtinArray): (Interpreter::builtinBoolean): (Interpreter::builtinString): (Interpreter::builtinNumber): (Interpreter::builtinDate): (Interpreter::builtinRegExp): (Interpreter::builtinError): (Interpreter::builtinObjectPrototype): (Interpreter::builtinFunctionPrototype): (Interpreter::builtinArrayPrototype): (Interpreter::builtinBooleanPrototype): (Interpreter::builtinStringPrototype): (Interpreter::builtinNumberPrototype): (Interpreter::builtinDatePrototype): (Interpreter::builtinRegExpPrototype): (Interpreter::builtinErrorPrototype): (Interpreter::builtinEvalError): (Interpreter::builtinRangeError): (Interpreter::builtinReferenceError): (Interpreter::builtinSyntaxError): (Interpreter::builtinTypeError): (Interpreter::builtinURIError): (Interpreter::builtinEvalErrorPrototype): (Interpreter::builtinRangeErrorPrototype): (Interpreter::builtinReferenceErrorPrototype): (Interpreter::builtinSyntaxErrorPrototype): (Interpreter::builtinTypeErrorPrototype): (Interpreter::builtinURIErrorPrototype): (Interpreter::createLanguageInstanceForValue):
  • kjs/interpreter.h: (KJS::Interpreter::isGlobalObject): (KJS::ExecState::setException): (KJS::ExecState::clearException): (KJS::ExecState::exception): (KJS::ExecState::hadException): (KJS::ExecState::ExecState):
  • kjs/list.cpp: (KJS::List::at):
  • kjs/list.h: (KJS::List::operator[]): (KJS::ListIterator::operator->): (KJS::ListIterator::operator*): (KJS::ListIterator::operator++): (KJS::ListIterator::operator--):
  • kjs/lookup.h: (KJS::staticFunctionGetter): (KJS::staticValueGetter): (KJS::lookupPut): (KJS::cacheGlobalObject):
  • kjs/math_object.cpp: (MathObjectImp::getValueProperty): (MathFuncImp::MathFuncImp): (MathFuncImp::callAsFunction):
  • kjs/math_object.h:
  • kjs/nodes.cpp: (Node::evaluateReference): (Node::throwError): (Node::setExceptionDetailsIfNeeded): (NullNode::evaluate): (BooleanNode::evaluate): (NumberNode::evaluate): (StringNode::evaluate): (RegExpNode::evaluate): (ThisNode::evaluate): (ResolveNode::evaluate): (ResolveNode::evaluateReference): (GroupNode::evaluate): (ElementNode::evaluate): (ArrayNode::evaluate): (ObjectLiteralNode::evaluate): (PropertyValueNode::evaluate): (PropertyNode::evaluate): (AccessorNode1::evaluate): (AccessorNode1::evaluateReference): (AccessorNode2::evaluate): (AccessorNode2::evaluateReference): (ArgumentListNode::evaluate): (ArgumentListNode::evaluateList): (ArgumentsNode::evaluate): (NewExprNode::evaluate): (FunctionCallNode::evaluate): (PostfixNode::evaluate): (DeleteNode::evaluate): (VoidNode::evaluate): (TypeOfNode::evaluate): (PrefixNode::evaluate): (UnaryPlusNode::evaluate): (NegateNode::evaluate): (BitwiseNotNode::evaluate): (LogicalNotNode::evaluate): (MultNode::evaluate): (AddNode::evaluate): (ShiftNode::evaluate): (RelationalNode::evaluate): (EqualNode::evaluate): (BitOperNode::evaluate): (BinaryLogicalNode::evaluate): (ConditionalNode::evaluate): (AssignNode::evaluate): (CommaNode::evaluate): (StatListNode::execute): (AssignExprNode::evaluate): (VarDeclNode::evaluate): (VarDeclNode::processVarDecls): (VarDeclListNode::evaluate): (ExprStatementNode::execute): (IfNode::execute): (DoWhileNode::execute): (WhileNode::execute): (ForNode::execute): (ForInNode::execute): (ContinueNode::execute): (BreakNode::execute): (ReturnNode::execute): (WithNode::execute): (CaseClauseNode::evaluate): (ClauseListNode::evaluate): (CaseBlockNode::evaluate): (CaseBlockNode::evalBlock): (SwitchNode::execute): (ThrowNode::execute): (CatchNode::execute): (TryNode::execute): (ParameterNode::evaluate): (FuncDeclNode::processFuncDecl): (FuncExprNode::evaluate): (SourceElementsNode::execute):
  • kjs/nodes.h: (KJS::StatementNode::evaluate):
  • kjs/number_object.cpp: (NumberPrototypeImp::NumberPrototypeImp): (NumberProtoFuncImp::NumberProtoFuncImp): (NumberProtoFuncImp::callAsFunction): (NumberObjectImp::NumberObjectImp): (NumberObjectImp::getValueProperty): (NumberObjectImp::construct): (NumberObjectImp::callAsFunction):
  • kjs/number_object.h:
  • kjs/object.cpp: (KJS::ObjectImp::call): (KJS::ObjectImp::mark): (KJS::ObjectImp::classInfo): (KJS::ObjectImp::get): (KJS::ObjectImp::getProperty): (KJS::ObjectImp::getPropertySlot): (KJS::ObjectImp::put): (KJS::ObjectImp::hasOwnProperty): (KJS::ObjectImp::defaultValue): (KJS::ObjectImp::findPropertyHashEntry): (KJS::ObjectImp::construct): (KJS::ObjectImp::callAsFunction): (KJS::ObjectImp::hasInstance): (KJS::ObjectImp::propList): (KJS::ObjectImp::toPrimitive): (KJS::ObjectImp::toNumber): (KJS::ObjectImp::toString): (KJS::ObjectImp::toObject): (KJS::ObjectImp::putDirect): (KJS::Error::create): (KJS::error):
  • kjs/object.h: (KJS::): (KJS::ObjectImp::getPropertySlot): (KJS::AllocatedValueImp::isObject): (KJS::ObjectImp::ObjectImp): (KJS::ObjectImp::internalValue): (KJS::ObjectImp::setInternalValue): (KJS::ObjectImp::prototype): (KJS::ObjectImp::setPrototype): (KJS::ObjectImp::inherits):
  • kjs/object_object.cpp: (ObjectPrototypeImp::ObjectPrototypeImp): (ObjectProtoFuncImp::ObjectProtoFuncImp): (ObjectProtoFuncImp::callAsFunction): (ObjectObjectImp::ObjectObjectImp): (ObjectObjectImp::construct): (ObjectObjectImp::callAsFunction):
  • kjs/object_object.h:
  • kjs/operations.cpp: (KJS::equal): (KJS::strictEqual): (KJS::relation): (KJS::add): (KJS::mult):
  • kjs/operations.h:
  • kjs/property_map.cpp: (KJS::PropertyMap::mark): (KJS::PropertyMap::addEnumerablesToReferenceList): (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): (KJS::PropertyMap::save): (KJS::PropertyMap::restore):
  • kjs/property_map.h:
  • kjs/property_slot.cpp: (KJS::PropertySlot::undefinedGetter):
  • kjs/property_slot.h: (KJS::PropertySlot::getValue):
  • kjs/protect.h: (KJS::gcUnprotectNullTolerant): (KJS::ProtectedValue::ProtectedValue): (KJS::ProtectedValue::~ProtectedValue): (KJS::ProtectedValue::operator=): (KJS::ProtectedValue::operator ValueImp *): (KJS::ProtectedValue::operator->):
  • kjs/protected_object.h: (KJS::ProtectedObject::ProtectedObject): (KJS::ProtectedObject::operator=): (KJS::ProtectedObject::operator ValueImp *): (KJS::ProtectedObject::operator ObjectImp *): (KJS::ProtectedObject::operator->): (KJS::ProtectedReference::ProtectedReference): (KJS::ProtectedReference::~ProtectedReference): (KJS::ProtectedReference::operator=):
  • kjs/protected_values.cpp: (KJS::ProtectedValues::getProtectCount): (KJS::ProtectedValues::increaseProtectCount): (KJS::ProtectedValues::insert): (KJS::ProtectedValues::decreaseProtectCount):
  • kjs/protected_values.h:
  • kjs/reference.cpp: (KJS::Reference::Reference): (KJS::Reference::makeValueReference): (KJS::Reference::getBase): (KJS::Reference::getValue): (KJS::Reference::putValue): (KJS::Reference::deleteValue):
  • kjs/reference.h: (KJS::Reference::baseIfMutable):
  • kjs/regexp_object.cpp: (RegExpPrototypeImp::RegExpPrototypeImp): (RegExpProtoFuncImp::RegExpProtoFuncImp): (RegExpProtoFuncImp::callAsFunction): (RegExpObjectImp::RegExpObjectImp): (RegExpObjectImp::arrayOfMatches): (RegExpObjectImp::backrefGetter): (RegExpObjectImp::construct): (RegExpObjectImp::callAsFunction):
  • kjs/regexp_object.h:
  • kjs/string_object.cpp: (StringInstanceImp::lengthGetter): (StringInstanceImp::indexGetter): (StringInstanceImp::getOwnPropertySlot): (StringInstanceImp::put): (StringPrototypeImp::StringPrototypeImp): (StringProtoFuncImp::StringProtoFuncImp): (regExpIsGlobal): (replace): (StringProtoFuncImp::callAsFunction): (StringObjectImp::StringObjectImp): (StringObjectImp::construct): (StringObjectImp::callAsFunction): (StringObjectFuncImp::StringObjectFuncImp): (StringObjectFuncImp::callAsFunction):
  • kjs/string_object.h:
  • kjs/testkjs.cpp: (TestFunctionImp::callAsFunction): (VersionFunctionImp::callAsFunction): (main):
  • kjs/value.cpp: (KJS::AllocatedValueImp::operator new): (KJS::AllocatedValueImp::getUInt32): (KJS::ValueImp::toInteger): (KJS::ValueImp::toInt32): (KJS::ValueImp::toUInt32): (KJS::ValueImp::toUInt16): (KJS::ValueImp::toObject): (KJS::AllocatedValueImp::getBoolean): (KJS::AllocatedValueImp::getNumber): (KJS::AllocatedValueImp::getString): (KJS::AllocatedValueImp::getObject): (KJS::jsString): (KJS::jsNumber): (KJS::ConstantValues::init): (KJS::ConstantValues::clear): (KJS::ConstantValues::mark):
  • kjs/value.h: (KJS::): (KJS::jsUndefined): (KJS::jsNull): (KJS::jsBoolean): (KJS::jsNaN): (KJS::ValueImp::ValueImp): (KJS::ValueImp::~ValueImp): (KJS::AllocatedValueImp::AllocatedValueImp): (KJS::AllocatedValueImp::~AllocatedValueImp): (KJS::AllocatedValueImp::isBoolean): (KJS::AllocatedValueImp::isNumber): (KJS::AllocatedValueImp::isString): (KJS::AllocatedValueImp::isObject): (KJS::AllocatedValueImp::marked): (KJS::AllocatedValueImp::mark): (KJS::ValueImp::downcast): (KJS::ValueImp::isUndefined): (KJS::ValueImp::isNull): (KJS::ValueImp::isUndefinedOrNull): (KJS::ValueImp::isBoolean): (KJS::ValueImp::isNumber): (KJS::ValueImp::isString): (KJS::ValueImp::isObject): (KJS::ValueImp::getBoolean): (KJS::ValueImp::getNumber): (KJS::ValueImp::getString): (KJS::ValueImp::getObject): (KJS::ValueImp::getUInt32): (KJS::ValueImp::mark): (KJS::ValueImp::marked): (KJS::ValueImp::type): (KJS::ValueImp::toPrimitive): (KJS::ValueImp::toBoolean): (KJS::ValueImp::toNumber): (KJS::ValueImp::toString): (KJS::jsZero): (KJS::jsOne): (KJS::jsTwo): (KJS::Undefined): (KJS::Null): (KJS::Boolean): (KJS::Number): (KJS::String):

WebCore:

Rubber stamped by Maciej.

  • khtml/ecma/domparser.cpp: (KJS::DOMParserConstructorImp::construct): (KJS::DOMParserProtoFunc::callAsFunction):
  • khtml/ecma/domparser.h:
  • khtml/ecma/kjs_binding.cpp: (KJS::ScriptInterpreter::ScriptInterpreter): (KJS::ScriptInterpreter::isGlobalObject): (KJS::ScriptInterpreter::createLanguageInstanceForValue): (KJS::getStringOrNull): (KJS::ValueToVariant): (KJS::setDOMException):
  • khtml/ecma/kjs_binding.h: (KJS::DOMFunction::toPrimitive): (KJS::cacheDOMObject):
  • khtml/ecma/kjs_css.cpp: (KJS::DOMCSSStyleDeclaration::indexGetter): (KJS::DOMCSSStyleDeclaration::cssPropertyGetter): (KJS::DOMCSSStyleDeclaration::getValueProperty): (KJS::DOMCSSStyleDeclaration::put): (KJS::DOMCSSStyleDeclarationProtoFunc::callAsFunction): (KJS::DOMStyleSheet::getValueProperty): (KJS::DOMStyleSheet::put): (KJS::DOMStyleSheetList::getValueProperty): (KJS::DOMStyleSheetList::indexGetter): (KJS::DOMStyleSheetList::nameGetter): (KJS::DOMStyleSheetListFunc::callAsFunction): (KJS::DOMMediaList::getValueProperty): (KJS::DOMMediaList::indexGetter): (KJS::DOMMediaList::put): (KJS::KJS::DOMMediaListProtoFunc::callAsFunction): (KJS::DOMCSSStyleSheet::getValueProperty): (KJS::DOMCSSStyleSheetProtoFunc::callAsFunction): (KJS::DOMCSSRuleList::getValueProperty): (KJS::DOMCSSRuleList::indexGetter): (KJS::DOMCSSRuleListFunc::callAsFunction): (KJS::DOMCSSRule::getValueProperty): (KJS::DOMCSSRule::put): (KJS::DOMCSSRule::putValueProperty): (KJS::DOMCSSRuleFunc::callAsFunction): (KJS::CSSRuleConstructor::getValueProperty): (KJS::getCSSRuleConstructor): (KJS::DOMCSSValue::getValueProperty): (KJS::DOMCSSValue::put): (KJS::getDOMCSSValue): (KJS::CSSValueConstructor::getValueProperty): (KJS::getCSSValueConstructor): (KJS::DOMCSSPrimitiveValue::getValueProperty): (KJS::DOMCSSPrimitiveValueProtoFunc::callAsFunction): (KJS::CSSPrimitiveValueConstructor::getValueProperty): (KJS::getCSSPrimitiveValueConstructor): (KJS::DOMCSSValueList::getValueProperty): (KJS::DOMCSSValueList::indexGetter): (KJS::DOMCSSValueListFunc::callAsFunction): (KJS::DOMRGBColor::getValueProperty): (KJS::DOMRect::getValueProperty): (KJS::DOMCounter::getValueProperty):
  • khtml/ecma/kjs_css.h:
  • khtml/ecma/kjs_dom.cpp: (KJS::DOMNode::getValueProperty): (KJS::DOMNode::put): (KJS::DOMNode::putValueProperty): (KJS::DOMNode::toPrimitive): (KJS::DOMNode::getListener): (KJS::DOMNodeProtoFunc::callAsFunction): (KJS::DOMNodeList::toPrimitive): (KJS::DOMNodeList::getValueProperty): (KJS::DOMNodeList::indexGetter): (KJS::DOMNodeList::nameGetter): (KJS::DOMNodeList::callAsFunction): (KJS::DOMNodeListFunc::DOMNodeListFunc): (KJS::DOMNodeListFunc::callAsFunction): (KJS::DOMAttr::getValueProperty): (KJS::DOMAttr::put): (KJS::DOMAttr::putValueProperty): (KJS::DOMDocument::getValueProperty): (KJS::DOMDocument::put): (KJS::DOMDocument::putValueProperty): (KJS::DOMDocumentProtoFunc::callAsFunction): (KJS::DOMElement::getValueProperty): (KJS::DOMElement::attributeGetter): (KJS::DOMElement::getOwnPropertySlot): (KJS::DOMElementProtoFunc::callAsFunction): (KJS::DOMDOMImplementationProtoFunc::callAsFunction): (KJS::DOMDocumentType::getValueProperty): (KJS::DOMNamedNodeMap::lengthGetter): (KJS::DOMNamedNodeMap::indexGetter): (KJS::DOMNamedNodeMapProtoFunc::callAsFunction): (KJS::DOMProcessingInstruction::getValueProperty): (KJS::DOMProcessingInstruction::put): (KJS::DOMNotation::getValueProperty): (KJS::DOMEntity::getValueProperty): (KJS::NodeConstructor::getValueProperty): (KJS::DOMExceptionConstructor::getValueProperty): (KJS::DOMNamedNodesCollection::lengthGetter): (KJS::DOMNamedNodesCollection::indexGetter): (KJS::DOMCharacterData::getValueProperty): (KJS::DOMCharacterData::put): (KJS::DOMCharacterDataProtoFunc::callAsFunction): (KJS::DOMTextProtoFunc::callAsFunction):
  • khtml/ecma/kjs_dom.h:
  • khtml/ecma/kjs_events.cpp: (KJS::JSAbstractEventListener::handleEvent): (KJS::JSUnprotectedEventListener::JSUnprotectedEventListener): (KJS::JSUnprotectedEventListener::~JSUnprotectedEventListener): (KJS::JSUnprotectedEventListener::listenerObj): (KJS::JSUnprotectedEventListener::windowObj): (KJS::JSUnprotectedEventListener::mark): (KJS::JSEventListener::JSEventListener): (KJS::JSEventListener::~JSEventListener): (KJS::JSEventListener::listenerObj): (KJS::JSEventListener::windowObj): (KJS::JSLazyEventListener::JSLazyEventListener): (KJS::JSLazyEventListener::handleEvent): (KJS::JSLazyEventListener::listenerObj): (KJS::JSLazyEventListener::parseCode): (KJS::getNodeEventListener): (KJS::EventConstructor::getValueProperty): (KJS::getEventConstructor): (KJS::DOMEvent::getValueProperty): (KJS::DOMEvent::put): (KJS::DOMEvent::putValueProperty): (KJS::DOMEventProtoFunc::callAsFunction): (KJS::getDOMEvent): (KJS::EventExceptionConstructor::getValueProperty): (KJS::getEventExceptionConstructor): (KJS::DOMUIEvent::getValueProperty): (KJS::DOMUIEventProtoFunc::callAsFunction): (KJS::DOMMouseEvent::getValueProperty): (KJS::DOMMouseEventProtoFunc::callAsFunction): (KJS::DOMKeyboardEvent::getValueProperty): (KJS::DOMKeyboardEventProtoFunc::callAsFunction): (KJS::MutationEventConstructor::getValueProperty): (KJS::getMutationEventConstructor): (KJS::DOMMutationEvent::getValueProperty): (KJS::DOMMutationEventProtoFunc::callAsFunction): (KJS::DOMWheelEvent::getValueProperty): (KJS::DOMWheelEventProtoFunc::callAsFunction): (KJS::stringOrUndefined): (KJS::Clipboard::getValueProperty): (KJS::Clipboard::put): (KJS::Clipboard::putValueProperty): (KJS::ClipboardProtoFunc::callAsFunction):
  • khtml/ecma/kjs_events.h: (KJS::JSAbstractEventListener::listenerObjImp):
  • khtml/ecma/kjs_html.cpp: (KJS::KJS::HTMLDocFunction::callAsFunction): (KJS::HTMLDocument::namedItemGetter): (KJS::HTMLDocument::getValueProperty): (KJS::KJS::HTMLDocument::put): (KJS::KJS::HTMLDocument::putValueProperty): (KJS::HTMLElement::formIndexGetter): (KJS::HTMLElement::formNameGetter): (KJS::HTMLElement::selectIndexGetter): (KJS::HTMLElement::framesetNameGetter): (KJS::HTMLElement::frameWindowPropertyGetter): (KJS::HTMLElement::runtimeObjectGetter): (KJS::HTMLElement::runtimeObjectPropertyGetter): (KJS::HTMLElement::getOwnPropertySlot): (KJS::KJS::HTMLElement::implementsCall): (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::KJS::HTMLElement::put): (KJS::HTMLElement::htmlSetter): (KJS::HTMLElement::headSetter): (KJS::HTMLElement::linkSetter): (KJS::HTMLElement::titleSetter): (KJS::HTMLElement::metaSetter): (KJS::HTMLElement::baseSetter): (KJS::HTMLElement::isIndexSetter): (KJS::HTMLElement::styleSetter): (KJS::HTMLElement::bodySetter): (KJS::HTMLElement::formSetter): (KJS::HTMLElement::selectSetter): (KJS::HTMLElement::optGroupSetter): (KJS::HTMLElement::optionSetter): (KJS::HTMLElement::inputSetter): (KJS::HTMLElement::textAreaSetter): (KJS::HTMLElement::buttonSetter): (KJS::HTMLElement::labelSetter): (KJS::HTMLElement::fieldSetSetter): (KJS::HTMLElement::legendSetter): (KJS::HTMLElement::uListSetter): (KJS::HTMLElement::oListSetter): (KJS::HTMLElement::dListSetter): (KJS::HTMLElement::dirSetter): (KJS::HTMLElement::menuSetter): (KJS::HTMLElement::liSetter): (KJS::HTMLElement::divSetter): (KJS::HTMLElement::paragraphSetter): (KJS::HTMLElement::headingSetter): (KJS::HTMLElement::blockQuoteSetter): (KJS::HTMLElement::quoteSetter): (KJS::HTMLElement::preSetter): (KJS::HTMLElement::brSetter): (KJS::HTMLElement::baseFontSetter): (KJS::HTMLElement::fontSetter): (KJS::HTMLElement::hrSetter): (KJS::HTMLElement::modSetter): (KJS::HTMLElement::anchorSetter): (KJS::HTMLElement::imageSetter): (KJS::HTMLElement::objectSetter): (KJS::HTMLElement::paramSetter): (KJS::HTMLElement::appletSetter): (KJS::HTMLElement::mapSetter): (KJS::HTMLElement::areaSetter): (KJS::HTMLElement::scriptSetter): (KJS::HTMLElement::tableSetter): (KJS::HTMLElement::tableCaptionSetter): (KJS::HTMLElement::tableColSetter): (KJS::HTMLElement::tableSectionSetter): (KJS::HTMLElement::tableRowSetter): (KJS::HTMLElement::tableCellSetter): (KJS::HTMLElement::frameSetSetter): (KJS::HTMLElement::frameSetter): (KJS::HTMLElement::iFrameSetter): (KJS::HTMLElement::marqueeSetter): (KJS::HTMLElement::putValueProperty): (KJS::HTMLCollection::lengthGetter): (KJS::HTMLCollection::indexGetter): (KJS::HTMLCollection::nameGetter): (KJS::HTMLCollection::getOwnPropertySlot): (KJS::KJS::HTMLCollection::callAsFunction): (KJS::KJS::HTMLCollection::getNamedItems): (KJS::KJS::HTMLCollectionProtoFunc::callAsFunction): (KJS::HTMLSelectCollection::selectedIndexGetter): (KJS::KJS::HTMLSelectCollection::put): (KJS::OptionConstructorImp::construct): (KJS::ImageConstructorImp::construct): (KJS::Image::getValueProperty): (KJS::Image::put): (KJS::Image::putValueProperty): (KJS::isGradient): (KJS::isImagePattern): (KJS::KJS::Context2DFunction::callAsFunction): (KJS::Context2D::getValueProperty): (KJS::Context2D::put): (KJS::colorRefFromValue): (KJS::colorFromValue): (KJS::Context2D::setShadow): (KJS::Context2D::updateFillImagePattern): (KJS::Context2D::updateStrokeImagePattern): (KJS::Context2D::putValueProperty): (KJS::Context2D::Context2D): (KJS::Context2D::mark): (KJS::GradientFunction::callAsFunction): (KJS::Gradient::getValueProperty): (KJS::Gradient::put): (KJS::Gradient::putValueProperty): (KJS::ImagePattern::getValueProperty): (KJS::ImagePattern::put): (KJS::ImagePattern::putValueProperty):
  • khtml/ecma/kjs_html.h:
  • khtml/ecma/kjs_navigator.cpp: (KJS::Navigator::getValueProperty): (KJS::Plugins::getValueProperty): (KJS::Plugins::indexGetter): (KJS::Plugins::nameGetter): (KJS::MimeTypes::getValueProperty): (KJS::MimeTypes::indexGetter): (KJS::MimeTypes::nameGetter): (KJS::Plugin::getValueProperty): (KJS::Plugin::indexGetter): (KJS::Plugin::nameGetter): (KJS::MimeType::getValueProperty): (KJS::PluginsFunc::callAsFunction): (KJS::NavigatorFunc::callAsFunction):
  • khtml/ecma/kjs_navigator.h:
  • khtml/ecma/kjs_proxy.cpp: (KJSProxyImpl::evaluate): (TestFunctionImp::callAsFunction): (KJSProxyImpl::initScript): (KJSProxy::proxy):
  • khtml/ecma/kjs_range.cpp: (KJS::DOMRange::getValueProperty): (KJS::DOMRangeProtoFunc::callAsFunction): (KJS::RangeConstructor::getValueProperty):
  • khtml/ecma/kjs_range.h:
  • khtml/ecma/kjs_traversal.cpp: (KJS::DOMNodeIterator::getValueProperty): (KJS::DOMNodeIteratorProtoFunc::callAsFunction): (KJS::NodeFilterConstructor::getValueProperty): (KJS::getNodeFilterConstructor): (KJS::DOMNodeFilterProtoFunc::callAsFunction): (KJS::DOMTreeWalker::getValueProperty): (KJS::DOMTreeWalker::put): (KJS::DOMTreeWalkerProtoFunc::callAsFunction): (KJS::JSNodeFilterCondition::JSNodeFilterCondition): (KJS::JSNodeFilterCondition::acceptNode):
  • khtml/ecma/kjs_traversal.h:
  • khtml/ecma/kjs_views.cpp: (KJS::DOMAbstractView::getValueProperty): (KJS::DOMAbstractViewFunc::callAsFunction):
  • khtml/ecma/kjs_views.h:
  • khtml/ecma/kjs_window.cpp: (KJS::Screen::getValueProperty): (KJS::Window::retrieveWindow): (KJS::Window::retrieveActive): (KJS::Window::retrieve): (KJS::parseFeatures): (KJS::showModalDialog): (KJS::Window::getValueProperty): (KJS::Window::childFrameGetter): (KJS::Window::namedFrameGetter): (KJS::Window::indexGetter): (KJS::Window::namedItemGetter): (KJS::Window::put): (KJS::Window::installTimeout): (KJS::Window::setListener): (KJS::Window::getListener): (KJS::Window::getJSEventListener): (KJS::Window::getJSUnprotectedEventListener): (KJS::Window::getJSLazyEventListener): (KJS::WindowFunc::callAsFunction): (KJS::ScheduledAction::ScheduledAction): (KJS::ScheduledAction::execute): (KJS::WindowQObject::installTimeout): (KJS::FrameArray::getValueProperty): (KJS::FrameArray::indexGetter): (KJS::FrameArray::nameGetter): (KJS::Location::getValueProperty): (KJS::Location::put): (KJS::Location::toPrimitive): (KJS::LocationFunc::callAsFunction): (KJS::Selection::getValueProperty): (KJS::Selection::toPrimitive): (KJS::SelectionFunc::callAsFunction): (KJS::BarInfo::getValueProperty): (KJS::History::getValueProperty): (KJS::HistoryFunc::callAsFunction): (KJS::Konqueror::get): (KJS::KonquerorFunc::callAsFunction):
  • khtml/ecma/kjs_window.h:
  • khtml/ecma/xmlhttprequest.cpp: (KJS::XMLHttpRequestConstructorImp::construct): (KJS::XMLHttpRequest::getValueProperty): (KJS::XMLHttpRequest::put): (KJS::XMLHttpRequest::putValueProperty): (KJS::XMLHttpRequest::getAllResponseHeaders): (KJS::XMLHttpRequest::getResponseHeader): (KJS::XMLHttpRequest::getStatus): (KJS::XMLHttpRequest::getStatusText): (KJS::XMLHttpRequestProtoFunc::callAsFunction):
  • khtml/ecma/xmlhttprequest.h:
  • khtml/ecma/xmlserializer.cpp: (KJS::XMLSerializerConstructorImp::construct): (KJS::XMLSerializerProtoFunc::callAsFunction):
  • khtml/ecma/xmlserializer.h:
  • kwq/DOMUtility.mm: (KJS::ScriptInterpreter::createObjcInstanceForValue):
  • kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::bindingRootObject): (KWQKHTMLPart::windowScriptObject): (KWQKHTMLPart::windowScriptNPObject):
  • kwq/WebCoreBridge.mm: (-[WebCoreBridge executionContextForView:]):
  • kwq/WebCoreScriptDebugger.mm: (WebCoreScriptDebuggerImp::callEvent): (WebCoreScriptDebuggerImp::returnEvent): (-[WebCoreScriptDebugger finalize]): (-[WebCoreScriptCallFrame _convertValueToObjcValue:]): (-[WebCoreScriptCallFrame scopeChain]): (-[WebCoreScriptCallFrame evaluateWebScript:]):
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.5 KB
Line 
1/*
2 * This file is part of the KDE libraries
3 * Copyright (C) 1999-2001 Harri Porten ([email protected])
4 * Copyright (C) 2001 Peter Kelly ([email protected])
5 * Copyright (C) 2003-2005 Apple Computer, Inc.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 */
23
24#ifndef KJS_VALUE_H
25#define KJS_VALUE_H
26
27#ifndef NDEBUG // protection against problems if committing with KJS_VERBOSE on
28
29// Uncomment this to enable very verbose output from KJS
30//#define KJS_VERBOSE
31// Uncomment this to debug memory allocation and garbage collection
32//#define KJS_DEBUG_MEM
33
34#endif
35
36#include <assert.h>
37#include <stdlib.h> // for size_t
38#include "simple_number.h"
39#include "ustring.h"
40
41namespace KJS {
42
43class ClassInfo;
44class ExecState;
45class ObjectImp;
46
47/**
48 * Primitive types
49 */
50enum Type {
51 UnspecifiedType = 0,
52 UndefinedType = 1,
53 NullType = 2,
54 BooleanType = 3,
55 StringType = 4,
56 NumberType = 5,
57 ObjectType = 6
58};
59
60/**
61 * ValueImp is the base type for all primitives (Undefined, Null, Boolean,
62 * String, Number) and objects in ECMAScript.
63 *
64 * Note: you should never inherit from ValueImp as it is for primitive types
65 * only (all of which are provided internally by KJS). Instead, inherit from
66 * ObjectImp.
67 */
68class ValueImp {
69 friend class AllocatedValueImp; // so it can derive from this class
70 friend class ProtectedValues; // so it can call downcast()
71
72private:
73 ValueImp();
74 ~ValueImp();
75
76public:
77 // Querying the type.
78 Type type() const;
79 bool isUndefined() const;
80 bool isNull() const;
81 bool isUndefinedOrNull() const;
82 bool isBoolean() const;
83 bool isNumber() const;
84 bool isString() const;
85 bool isObject() const;
86 bool isObject(const ClassInfo *) const;
87
88 // Extracting the value.
89 bool getBoolean(bool&) const;
90 bool getNumber(double&) const;
91 double getNumber() const; // NaN if not a number
92 bool getString(UString&) const;
93 UString getString() const; // null string if not a string
94 ObjectImp *getObject(); // NULL if not an object
95 const ObjectImp *getObject() const; // NULL if not an object
96
97 // Extracting integer values.
98 bool getUInt32(uint32_t&) const;
99
100 // Basic conversions.
101 ValueImp *toPrimitive(ExecState *exec, Type preferredType = UnspecifiedType) const;
102 bool toBoolean(ExecState *exec) const;
103 double toNumber(ExecState *exec) const;
104 double toNumber(ExecState *exec, bool& knownToBeInteger) const;
105 UString toString(ExecState *exec) const;
106 ObjectImp *toObject(ExecState *exec) const;
107
108 // Integer conversions.
109 double toInteger(ExecState *exec) const;
110 int32_t toInt32(ExecState *exec) const;
111 uint32_t toUInt32(ExecState *exec) const;
112 uint16_t toUInt16(ExecState *exec) const;
113
114 // Garbage collection.
115 void mark();
116 bool marked() const;
117
118private:
119 // Implementation details.
120 AllocatedValueImp *downcast();
121 const AllocatedValueImp *downcast() const;
122
123 // Give a compile time error if we try to copy one of these.
124 ValueImp(const ValueImp&);
125 ValueImp& operator=(const ValueImp&);
126};
127
128class AllocatedValueImp : public ValueImp {
129 friend class Collector;
130 friend class UndefinedImp;
131 friend class NullImp;
132 friend class BooleanImp;
133 friend class NumberImp;
134 friend class StringImp;
135 friend class ObjectImp;
136private:
137 AllocatedValueImp();
138 virtual ~AllocatedValueImp();
139public:
140 // Querying the type.
141 virtual Type type() const = 0;
142 bool isBoolean() const;
143 bool isNumber() const;
144 bool isString() const;
145 bool isObject() const;
146 bool isObject(const ClassInfo *) const;
147
148 // Extracting the value.
149 bool getBoolean(bool&) const;
150 bool getNumber(double&) const;
151 double getNumber() const; // NaN if not a number
152 bool getString(UString&) const;
153 UString getString() const; // null string if not a string
154 ObjectImp *getObject(); // NULL if not an object
155 const ObjectImp *getObject() const; // NULL if not an object
156
157 // Extracting integer values.
158 virtual bool getUInt32(uint32_t&) const;
159
160 // Basic conversions.
161 virtual ValueImp *toPrimitive(ExecState *exec, Type preferredType = UnspecifiedType) const = 0;
162 virtual bool toBoolean(ExecState *exec) const = 0;
163 virtual double toNumber(ExecState *exec) const = 0;
164 double toNumber(ExecState *exec, bool& knownToBeInteger) const;
165 virtual UString toString(ExecState *exec) const = 0;
166 virtual ObjectImp *toObject(ExecState *exec) const = 0;
167
168 // Garbage collection.
169 void *operator new(size_t);
170 virtual void mark();
171 bool marked() const;
172
173private:
174 bool m_marked;
175};
176
177AllocatedValueImp *jsUndefined();
178AllocatedValueImp *jsNull();
179
180AllocatedValueImp *jsBoolean(bool = false);
181
182ValueImp *jsNumber(double);
183ValueImp *jsNumber(double, bool knownToBeInteger);
184AllocatedValueImp *jsNaN();
185ValueImp *jsZero();
186ValueImp *jsOne();
187ValueImp *jsTwo();
188ValueImp *jsNumber(int);
189ValueImp *jsNumber(unsigned);
190ValueImp *jsNumber(long);
191ValueImp *jsNumber(unsigned long);
192
193AllocatedValueImp *jsString(const UString &); // returns empty string if passed null string
194AllocatedValueImp *jsString(const char * = ""); // returns empty string if passed 0
195
196extern const double NaN;
197extern const double Inf;
198
199class ConstantValues {
200public:
201 static AllocatedValueImp *undefined;
202 static AllocatedValueImp *null;
203 static AllocatedValueImp *jsFalse;
204 static AllocatedValueImp *jsTrue;
205 static AllocatedValueImp *NaN;
206
207 static void init();
208 static void clear();
209 static void mark();
210};
211
212inline AllocatedValueImp *jsUndefined()
213{
214 return ConstantValues::undefined;
215}
216
217inline AllocatedValueImp *jsNull()
218{
219 return ConstantValues::null;
220}
221
222inline AllocatedValueImp *jsBoolean(bool b)
223{
224 return b ? ConstantValues::jsTrue : ConstantValues::jsFalse;
225}
226
227inline AllocatedValueImp *jsNaN()
228{
229 return ConstantValues::NaN;
230}
231
232inline ValueImp::ValueImp()
233{
234}
235
236inline ValueImp::~ValueImp()
237{
238}
239
240inline AllocatedValueImp::AllocatedValueImp()
241 : m_marked(false)
242{
243}
244
245inline AllocatedValueImp::~AllocatedValueImp()
246{
247}
248
249inline bool AllocatedValueImp::isBoolean() const
250{
251 return type() == BooleanType;
252}
253
254inline bool AllocatedValueImp::isNumber() const
255{
256 return type() == NumberType;
257}
258
259inline bool AllocatedValueImp::isString() const
260{
261 return type() == StringType;
262}
263
264inline bool AllocatedValueImp::isObject() const
265{
266 return type() == ObjectType;
267}
268
269inline bool AllocatedValueImp::marked() const
270{
271 return m_marked;
272}
273
274inline void AllocatedValueImp::mark()
275{
276 m_marked = true;
277}
278
279inline AllocatedValueImp *ValueImp::downcast()
280{
281 assert(!SimpleNumber::is(this));
282 return static_cast<AllocatedValueImp *>(this);
283}
284
285inline const AllocatedValueImp *ValueImp::downcast() const
286{
287 assert(!SimpleNumber::is(this));
288 return static_cast<const AllocatedValueImp *>(this);
289}
290
291inline bool ValueImp::isUndefined() const
292{
293 return this == jsUndefined();
294}
295
296inline bool ValueImp::isNull() const
297{
298 return this == jsNull();
299}
300
301inline bool ValueImp::isUndefinedOrNull() const
302{
303 return this == jsUndefined() || this == jsNull();
304}
305
306inline bool ValueImp::isBoolean() const
307{
308 return !SimpleNumber::is(this) && downcast()->isBoolean();
309}
310
311inline bool ValueImp::isNumber() const
312{
313 return SimpleNumber::is(this) || downcast()->isNumber();
314}
315
316inline bool ValueImp::isString() const
317{
318 return !SimpleNumber::is(this) && downcast()->isString();
319}
320
321inline bool ValueImp::isObject() const
322{
323 return !SimpleNumber::is(this) && downcast()->isObject();
324}
325
326inline bool ValueImp::isObject(const ClassInfo *c) const
327{
328 return !SimpleNumber::is(this) && downcast()->isObject(c);
329}
330
331inline bool ValueImp::getBoolean(bool& v) const
332{
333 return !SimpleNumber::is(this) && downcast()->getBoolean(v);
334}
335
336inline bool ValueImp::getNumber(double& v) const
337{
338 if (SimpleNumber::is(this)) {
339 v = SimpleNumber::value(this);
340 return true;
341 }
342 return downcast()->getNumber(v);
343}
344
345inline double ValueImp::getNumber() const
346{
347 return SimpleNumber::is(this) ? SimpleNumber::value(this) : downcast()->getNumber();
348}
349
350inline bool ValueImp::getString(UString& s) const
351{
352 return !SimpleNumber::is(this) && downcast()->getString(s);
353}
354
355inline UString ValueImp::getString() const
356{
357 return SimpleNumber::is(this) ? UString() : downcast()->getString();
358}
359
360inline ObjectImp *ValueImp::getObject()
361{
362 return SimpleNumber::is(this) ? 0 : downcast()->getObject();
363}
364
365inline const ObjectImp *ValueImp::getObject() const
366{
367 return SimpleNumber::is(this) ? 0 : downcast()->getObject();
368}
369
370inline bool ValueImp::getUInt32(uint32_t& v) const
371{
372 if (SimpleNumber::is(this)) {
373 long i = SimpleNumber::value(this);
374 if (i < 0)
375 return false;
376 v = i;
377 return true;
378 }
379 return downcast()->getUInt32(v);
380}
381
382inline void ValueImp::mark()
383{
384 if (!SimpleNumber::is(this))
385 downcast()->mark();
386}
387
388inline bool ValueImp::marked() const
389{
390 return SimpleNumber::is(this) || downcast()->marked();
391}
392
393inline Type ValueImp::type() const
394{
395 return SimpleNumber::is(this) ? NumberType : downcast()->type();
396}
397
398inline ValueImp *ValueImp::toPrimitive(ExecState *exec, Type preferredType) const
399{
400 return SimpleNumber::is(this) ? const_cast<ValueImp *>(this) : downcast()->toPrimitive(exec, preferredType);
401}
402
403inline bool ValueImp::toBoolean(ExecState *exec) const
404{
405 return SimpleNumber::is(this) ? SimpleNumber::value(this) : downcast()->toBoolean(exec);
406}
407
408inline double ValueImp::toNumber(ExecState *exec) const
409{
410 return SimpleNumber::is(this) ? SimpleNumber::value(this) : downcast()->toNumber(exec);
411}
412
413inline double ValueImp::toNumber(ExecState *exec, bool& knownToBeInteger) const
414{
415 if (SimpleNumber::is(this)) {
416 knownToBeInteger = true;
417 return SimpleNumber::value(this);
418 }
419 knownToBeInteger = false;
420 return downcast()->toNumber(exec);
421}
422
423inline UString ValueImp::toString(ExecState *exec) const
424{
425 return SimpleNumber::is(this) ? UString::from(SimpleNumber::value(this)) : downcast()->toString(exec);
426}
427
428inline ValueImp *jsZero()
429{
430 return SimpleNumber::make(0);
431}
432
433inline ValueImp *jsOne()
434{
435 return SimpleNumber::make(1);
436}
437
438inline ValueImp *jsTwo()
439{
440 return SimpleNumber::make(2);
441}
442
443// compatibility names so we don't have to change so much code
444
445inline AllocatedValueImp *Undefined() { return jsUndefined(); }
446inline AllocatedValueImp *Null() { return jsNull(); }
447inline AllocatedValueImp *Boolean(bool b) { return jsBoolean(b); }
448inline ValueImp *Number(double n) { return jsNumber(n); }
449inline ValueImp *Number(int n) { return jsNumber(n); }
450inline ValueImp *Number(unsigned n) { return jsNumber(n); }
451inline ValueImp *Number(long n) { return jsNumber(n); }
452inline ValueImp *Number(unsigned long n) { return jsNumber(n); }
453inline AllocatedValueImp *String(const UString& s) { return jsString(s); }
454inline AllocatedValueImp *String(const char *s) { return jsString(s); }
455
456} // namespace
457
458#endif // KJS_VALUE_H
Note: See TracBrowser for help on using the repository browser.