source: webkit/trunk/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp@ 40046

Last change on this file since 40046 was 40046, checked in by [email protected], 16 years ago

JavaScriptCore:

2009-01-19 Sam Weinig <[email protected]>

Rubber-stamped by Gavin Barraclough.

Remove temporary operator-> from JSValuePtr.

  • API/JSCallbackFunction.cpp: (JSC::JSCallbackFunction::call):
  • API/JSCallbackObjectFunctions.h: (JSC::::call): (JSC::::toNumber): (JSC::::toString):
  • API/JSObjectRef.cpp: (JSObjectSetPrototype):
  • API/JSValueRef.cpp: (JSValueGetType): (JSValueIsUndefined): (JSValueIsNull): (JSValueIsBoolean): (JSValueIsNumber): (JSValueIsString): (JSValueIsObject): (JSValueIsObjectOfClass): (JSValueToBoolean): (JSValueToNumber): (JSValueToStringCopy): (JSValueToObject):
  • bytecode/CodeBlock.cpp: (JSC::valueToSourceString): (JSC::CodeBlock::mark):
  • bytecode/CodeBlock.h: (JSC::CodeBlock::isKnownNotImmediate):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitEqualityOp): (JSC::keyForImmediateSwitch):
  • interpreter/Interpreter.cpp: (JSC::jsLess): (JSC::jsLessEq): (JSC::jsAddSlowCase): (JSC::jsAdd): (JSC::jsTypeStringForValue): (JSC::jsIsObjectType): (JSC::jsIsFunctionType): (JSC::isNotObject): (JSC::Interpreter::callEval): (JSC::Interpreter::throwException): (JSC::cachePrototypeChain): (JSC::Interpreter::tryCachePutByID): (JSC::countPrototypeChainEntriesAndCheckForProxies): (JSC::Interpreter::tryCacheGetByID): (JSC::Interpreter::privateExecute): (JSC::Interpreter::tryCTICachePutByID): (JSC::Interpreter::tryCTICacheGetByID): (JSC::Interpreter::cti_op_convert_this): (JSC::Interpreter::cti_op_add): (JSC::Interpreter::cti_op_pre_inc): (JSC::Interpreter::cti_op_put_by_id_generic): (JSC::Interpreter::cti_op_get_by_id_generic): (JSC::Interpreter::cti_op_put_by_id): (JSC::Interpreter::cti_op_put_by_id_second): (JSC::Interpreter::cti_op_put_by_id_fail): (JSC::Interpreter::cti_op_get_by_id): (JSC::Interpreter::cti_op_get_by_id_second): (JSC::Interpreter::cti_op_get_by_id_self_fail): (JSC::Interpreter::cti_op_get_by_id_proto_list): (JSC::Interpreter::cti_op_get_by_id_proto_list_full): (JSC::Interpreter::cti_op_get_by_id_proto_fail): (JSC::Interpreter::cti_op_get_by_id_array_fail): (JSC::Interpreter::cti_op_get_by_id_string_fail): (JSC::Interpreter::cti_op_instanceof): (JSC::Interpreter::cti_op_del_by_id): (JSC::Interpreter::cti_op_mul): (JSC::Interpreter::cti_op_call_JSFunction): (JSC::Interpreter::cti_op_call_NotJSFunction): (JSC::Interpreter::cti_op_construct_JSConstruct): (JSC::Interpreter::cti_op_construct_NotJSConstruct): (JSC::Interpreter::cti_op_get_by_val): (JSC::Interpreter::cti_op_get_by_val_byte_array): (JSC::Interpreter::cti_op_sub): (JSC::Interpreter::cti_op_put_by_val): (JSC::Interpreter::cti_op_put_by_val_array): (JSC::Interpreter::cti_op_put_by_val_byte_array): (JSC::Interpreter::cti_op_loop_if_true): (JSC::Interpreter::cti_op_negate): (JSC::Interpreter::cti_op_div): (JSC::Interpreter::cti_op_pre_dec): (JSC::Interpreter::cti_op_not): (JSC::Interpreter::cti_op_jtrue): (JSC::Interpreter::cti_op_post_inc): (JSC::Interpreter::cti_op_lshift): (JSC::Interpreter::cti_op_bitand): (JSC::Interpreter::cti_op_rshift): (JSC::Interpreter::cti_op_bitnot): (JSC::Interpreter::cti_op_mod): (JSC::Interpreter::cti_op_post_dec): (JSC::Interpreter::cti_op_urshift): (JSC::Interpreter::cti_op_bitxor): (JSC::Interpreter::cti_op_bitor): (JSC::Interpreter::cti_op_push_scope): (JSC::Interpreter::cti_op_is_undefined): (JSC::Interpreter::cti_op_is_boolean): (JSC::Interpreter::cti_op_is_number): (JSC::Interpreter::cti_op_to_jsnumber): (JSC::Interpreter::cti_op_in): (JSC::Interpreter::cti_op_put_by_index): (JSC::Interpreter::cti_op_switch_imm): (JSC::Interpreter::cti_op_switch_char): (JSC::Interpreter::cti_op_switch_string): (JSC::Interpreter::cti_op_del_by_val): (JSC::Interpreter::cti_op_put_getter): (JSC::Interpreter::cti_op_put_setter): (JSC::Interpreter::cti_op_new_error):
  • interpreter/Interpreter.h: (JSC::Interpreter::isJSArray): (JSC::Interpreter::isJSString): (JSC::Interpreter::isJSByteArray):
  • interpreter/Register.h: (JSC::Register::marked): (JSC::Register::mark):
  • jit/JITInlineMethods.h: (JSC::JIT::getConstantOperandImmediateInt): (JSC::JIT::isOperandConstantImmediateInt):
  • jsc.cpp: (functionPrint): (functionDebug): (functionRun): (functionLoad): (runWithScripts): (runInteractive):
  • parser/Nodes.cpp: (JSC::processClauseList):
  • profiler/ProfileGenerator.cpp: (JSC::ProfileGenerator::addParentForConsoleStart):
  • profiler/Profiler.cpp: (JSC::Profiler::createCallIdentifier):
  • runtime/ArrayConstructor.cpp: (JSC::constructArrayWithSizeQuirk):
  • runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncToString): (JSC::arrayProtoFuncToLocaleString): (JSC::arrayProtoFuncJoin): (JSC::arrayProtoFuncConcat): (JSC::arrayProtoFuncPop): (JSC::arrayProtoFuncPush): (JSC::arrayProtoFuncReverse): (JSC::arrayProtoFuncShift): (JSC::arrayProtoFuncSlice): (JSC::arrayProtoFuncSort): (JSC::arrayProtoFuncSplice): (JSC::arrayProtoFuncUnShift): (JSC::arrayProtoFuncFilter): (JSC::arrayProtoFuncMap): (JSC::arrayProtoFuncEvery): (JSC::arrayProtoFuncForEach): (JSC::arrayProtoFuncSome): (JSC::arrayProtoFuncIndexOf): (JSC::arrayProtoFuncLastIndexOf):
  • runtime/BooleanConstructor.cpp: (JSC::constructBoolean): (JSC::callBooleanConstructor):
  • runtime/BooleanPrototype.cpp: (JSC::booleanProtoFuncToString): (JSC::booleanProtoFuncValueOf):
  • runtime/Collector.cpp: (JSC::Heap::protect): (JSC::Heap::unprotect): (JSC::Heap::heap): (JSC::Heap::collect): (JSC::typeName):
  • runtime/Completion.cpp: (JSC::evaluate):
  • runtime/DateConstructor.cpp: (JSC::constructDate): (JSC::dateParse): (JSC::dateUTC):
  • runtime/DateInstance.h: (JSC::DateInstance::internalNumber):
  • runtime/DatePrototype.cpp: (JSC::formatLocaleDate): (JSC::fillStructuresUsingTimeArgs): (JSC::fillStructuresUsingDateArgs): (JSC::dateProtoFuncToString): (JSC::dateProtoFuncToUTCString): (JSC::dateProtoFuncToDateString): (JSC::dateProtoFuncToTimeString): (JSC::dateProtoFuncToLocaleString): (JSC::dateProtoFuncToLocaleDateString): (JSC::dateProtoFuncToLocaleTimeString): (JSC::dateProtoFuncGetTime): (JSC::dateProtoFuncGetFullYear): (JSC::dateProtoFuncGetUTCFullYear): (JSC::dateProtoFuncToGMTString): (JSC::dateProtoFuncGetMonth): (JSC::dateProtoFuncGetUTCMonth): (JSC::dateProtoFuncGetDate): (JSC::dateProtoFuncGetUTCDate): (JSC::dateProtoFuncGetDay): (JSC::dateProtoFuncGetUTCDay): (JSC::dateProtoFuncGetHours): (JSC::dateProtoFuncGetUTCHours): (JSC::dateProtoFuncGetMinutes): (JSC::dateProtoFuncGetUTCMinutes): (JSC::dateProtoFuncGetSeconds): (JSC::dateProtoFuncGetUTCSeconds): (JSC::dateProtoFuncGetMilliSeconds): (JSC::dateProtoFuncGetUTCMilliseconds): (JSC::dateProtoFuncGetTimezoneOffset): (JSC::dateProtoFuncSetTime): (JSC::setNewValueFromTimeArgs): (JSC::setNewValueFromDateArgs): (JSC::dateProtoFuncSetYear): (JSC::dateProtoFuncGetYear):
  • runtime/ErrorConstructor.cpp: (JSC::constructError):
  • runtime/ErrorPrototype.cpp: (JSC::errorProtoFuncToString):
  • runtime/ExceptionHelpers.cpp: (JSC::createError): (JSC::createErrorMessage):
  • runtime/FunctionConstructor.cpp: (JSC::constructFunction):
  • runtime/FunctionPrototype.cpp: (JSC::functionProtoFuncToString): (JSC::functionProtoFuncApply): (JSC::functionProtoFuncCall):
  • runtime/GetterSetter.cpp: (JSC::GetterSetter::toObject):
  • runtime/JSActivation.cpp: (JSC::JSActivation::getOwnPropertySlot):
  • runtime/JSArray.cpp: (JSC::JSArray::put): (JSC::JSArray::mark): (JSC::JSArray::sort): (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key): (JSC::JSArray::compactForSorting):
  • runtime/JSByteArray.h: (JSC::JSByteArray::setIndex):
  • runtime/JSCell.h: (JSC::asCell):
  • runtime/JSFunction.cpp: (JSC::JSFunction::call): (JSC::JSFunction::construct):
  • runtime/JSGlobalObject.cpp: (JSC::markIfNeeded): (JSC::lastInPrototypeChain):
  • runtime/JSGlobalObjectFunctions.cpp: (JSC::encode): (JSC::decode): (JSC::globalFuncEval): (JSC::globalFuncParseInt): (JSC::globalFuncParseFloat): (JSC::globalFuncIsNaN): (JSC::globalFuncIsFinite): (JSC::globalFuncEscape): (JSC::globalFuncUnescape): (JSC::globalFuncJSCPrint):
  • runtime/JSImmediate.cpp: (JSC::JSImmediate::toThisObject): (JSC::JSImmediate::toObject): (JSC::JSImmediate::prototype): (JSC::JSImmediate::toString):
  • runtime/JSImmediate.h:
  • runtime/JSObject.cpp: (JSC::JSObject::mark): (JSC::JSObject::put): (JSC::callDefaultValueFunction): (JSC::JSObject::getPrimitiveNumber): (JSC::JSObject::defineGetter): (JSC::JSObject::defineSetter): (JSC::JSObject::lookupGetter): (JSC::JSObject::lookupSetter): (JSC::JSObject::hasInstance): (JSC::JSObject::toNumber): (JSC::JSObject::toString):
  • runtime/JSObject.h: (JSC::JSObject::JSObject): (JSC::JSObject::inlineGetOwnPropertySlot): (JSC::JSObject::getOwnPropertySlotForWrite): (JSC::JSObject::getPropertySlot): (JSC::JSValuePtr::get):
  • runtime/JSPropertyNameIterator.h: (JSC::JSPropertyNameIterator::create):
  • runtime/JSString.cpp: (JSC::JSString::getOwnPropertySlot):
  • runtime/JSValue.h:
  • runtime/JSWrapperObject.cpp: (JSC::JSWrapperObject::mark):
  • runtime/JSWrapperObject.h: (JSC::JSWrapperObject::setInternalValue):
  • runtime/MathObject.cpp: (JSC::mathProtoFuncAbs): (JSC::mathProtoFuncACos): (JSC::mathProtoFuncASin): (JSC::mathProtoFuncATan): (JSC::mathProtoFuncATan2): (JSC::mathProtoFuncCeil): (JSC::mathProtoFuncCos): (JSC::mathProtoFuncExp): (JSC::mathProtoFuncFloor): (JSC::mathProtoFuncLog): (JSC::mathProtoFuncMax): (JSC::mathProtoFuncMin): (JSC::mathProtoFuncPow): (JSC::mathProtoFuncRound): (JSC::mathProtoFuncSin): (JSC::mathProtoFuncSqrt): (JSC::mathProtoFuncTan):
  • runtime/NativeErrorConstructor.cpp: (JSC::NativeErrorConstructor::NativeErrorConstructor): (JSC::NativeErrorConstructor::construct):
  • runtime/NumberConstructor.cpp: (JSC::constructWithNumberConstructor): (JSC::callNumberConstructor):
  • runtime/NumberPrototype.cpp: (JSC::numberProtoFuncToString): (JSC::numberProtoFuncToLocaleString): (JSC::numberProtoFuncValueOf): (JSC::numberProtoFuncToFixed): (JSC::numberProtoFuncToExponential): (JSC::numberProtoFuncToPrecision):
  • runtime/ObjectConstructor.cpp: (JSC::constructObject):
  • runtime/ObjectPrototype.cpp: (JSC::objectProtoFuncValueOf): (JSC::objectProtoFuncHasOwnProperty): (JSC::objectProtoFuncIsPrototypeOf): (JSC::objectProtoFuncDefineGetter): (JSC::objectProtoFuncDefineSetter): (JSC::objectProtoFuncLookupGetter): (JSC::objectProtoFuncLookupSetter): (JSC::objectProtoFuncPropertyIsEnumerable): (JSC::objectProtoFuncToLocaleString): (JSC::objectProtoFuncToString):
  • runtime/Operations.h: (JSC::JSValuePtr::equalSlowCaseInline): (JSC::JSValuePtr::strictEqual): (JSC::JSValuePtr::strictEqualSlowCaseInline):
  • runtime/Protect.h: (JSC::gcProtect): (JSC::gcUnprotect):
  • runtime/RegExpConstructor.cpp: (JSC::setRegExpConstructorInput): (JSC::setRegExpConstructorMultiline): (JSC::constructRegExp):
  • runtime/RegExpObject.cpp: (JSC::setRegExpObjectLastIndex): (JSC::RegExpObject::match):
  • runtime/RegExpPrototype.cpp: (JSC::regExpProtoFuncTest): (JSC::regExpProtoFuncExec): (JSC::regExpProtoFuncCompile): (JSC::regExpProtoFuncToString):
  • runtime/StringConstructor.cpp: (JSC::stringFromCharCodeSlowCase): (JSC::stringFromCharCode): (JSC::constructWithStringConstructor): (JSC::callStringConstructor):
  • runtime/StringPrototype.cpp: (JSC::stringProtoFuncReplace): (JSC::stringProtoFuncToString): (JSC::stringProtoFuncCharAt): (JSC::stringProtoFuncCharCodeAt): (JSC::stringProtoFuncConcat): (JSC::stringProtoFuncIndexOf): (JSC::stringProtoFuncLastIndexOf): (JSC::stringProtoFuncMatch): (JSC::stringProtoFuncSearch): (JSC::stringProtoFuncSlice): (JSC::stringProtoFuncSplit): (JSC::stringProtoFuncSubstr): (JSC::stringProtoFuncSubstring): (JSC::stringProtoFuncToLowerCase): (JSC::stringProtoFuncToUpperCase): (JSC::stringProtoFuncLocaleCompare): (JSC::stringProtoFuncBig): (JSC::stringProtoFuncSmall): (JSC::stringProtoFuncBlink): (JSC::stringProtoFuncBold): (JSC::stringProtoFuncFixed): (JSC::stringProtoFuncItalics): (JSC::stringProtoFuncStrike): (JSC::stringProtoFuncSub): (JSC::stringProtoFuncSup): (JSC::stringProtoFuncFontcolor): (JSC::stringProtoFuncFontsize): (JSC::stringProtoFuncAnchor): (JSC::stringProtoFuncLink):
  • runtime/Structure.cpp: (JSC::Structure::Structure): (JSC::Structure::getEnumerablePropertyNames): (JSC::Structure::createCachedPrototypeChain):
  • runtime/Structure.h: (JSC::Structure::mark):
  • runtime/StructureChain.cpp: (JSC::StructureChain::StructureChain):

JavaScriptGlue:

2009-01-19 Sam Weinig <[email protected]>

Rubber-stamped by Gavin Barraclough.

Remove temporary operator-> from JSValuePtr.

  • JSUtils.cpp: (KJSValueToJSObject): (KJSValueToCFTypeInternal):
  • JSValueWrapper.cpp: (JSValueWrapper::JSObjectCopyPropertyNames): (JSValueWrapper::JSObjectCopyProperty): (JSValueWrapper::JSObjectSetProperty): (JSValueWrapper::JSObjectCallFunction): (JSValueWrapper::JSObjectMark):
  • UserObjectImp.cpp: (UserObjectImp::getOwnPropertySlot):

WebCore:

2009-01-19 Sam Weinig <[email protected]>

Rubber-stamped by Gavin Barraclough.

Remove temporary operator-> from JSValuePtr.

  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSAudioConstructor.cpp: (WebCore::constructAudio):
  • bindings/js/JSCanvasRenderingContext2DCustom.cpp: (WebCore::toHTMLCanvasStyle): (WebCore::JSCanvasRenderingContext2D::setFillColor): (WebCore::JSCanvasRenderingContext2D::setStrokeColor): (WebCore::JSCanvasRenderingContext2D::strokeRect): (WebCore::JSCanvasRenderingContext2D::drawImage): (WebCore::JSCanvasRenderingContext2D::drawImageFromRect): (WebCore::JSCanvasRenderingContext2D::setShadow): (WebCore::JSCanvasRenderingContext2D::createPattern): (WebCore::JSCanvasRenderingContext2D::putImageData): (WebCore::JSCanvasRenderingContext2D::fillText): (WebCore::JSCanvasRenderingContext2D::strokeText):
  • bindings/js/JSClipboardCustom.cpp: (WebCore::JSClipboard::clearData): (WebCore::JSClipboard::getData): (WebCore::JSClipboard::setData): (WebCore::JSClipboard::setDragImage):
  • bindings/js/JSCustomPositionCallback.cpp: (WebCore::JSCustomPositionCallback::handleEvent):
  • bindings/js/JSCustomPositionErrorCallback.cpp: (WebCore::JSCustomPositionErrorCallback::handleEvent):
  • bindings/js/JSCustomSQLStatementCallback.cpp: (WebCore::JSCustomSQLStatementCallback::handleEvent):
  • bindings/js/JSCustomSQLStatementErrorCallback.cpp: (WebCore::JSCustomSQLStatementErrorCallback::handleEvent):
  • bindings/js/JSCustomSQLTransactionCallback.cpp: (WebCore::JSCustomSQLTransactionCallback::handleEvent):
  • bindings/js/JSCustomSQLTransactionErrorCallback.cpp: (WebCore::JSCustomSQLTransactionErrorCallback::handleEvent):
  • bindings/js/JSCustomVoidCallback.cpp: (WebCore::JSCustomVoidCallback::handleEvent): (WebCore::toVoidCallback):
  • bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::create): (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
  • bindings/js/JSDOMApplicationCacheCustom.cpp: (WebCore::JSDOMApplicationCache::hasItem): (WebCore::JSDOMApplicationCache::add): (WebCore::JSDOMApplicationCache::remove): (WebCore::JSDOMApplicationCache::addEventListener): (WebCore::JSDOMApplicationCache::removeEventListener):
  • bindings/js/JSDOMBinding.cpp: (WebCore::valueToStringWithNullCheck): (WebCore::valueToStringWithUndefinedOrNullCheck): (WebCore::reportException):
  • bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::findJSEventListener): (WebCore::JSDOMGlobalObject::findOrCreateJSEventListener): (WebCore::JSDOMGlobalObject::findJSUnprotectedEventListener): (WebCore::JSDOMGlobalObject::findOrCreateJSUnprotectedEventListener):
  • bindings/js/JSDOMStringListCustom.cpp: (WebCore::JSDOMStringList::item):
  • bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::getOwnPropertySlot): (windowProtoFuncOpen): (WebCore::toJSDOMWindow):
  • bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::setLocation): (WebCore::JSDOMWindow::postMessage): (WebCore::setTimeoutOrInterval): (WebCore::JSDOMWindow::clearTimeout): (WebCore::JSDOMWindow::clearInterval): (WebCore::JSDOMWindow::atob): (WebCore::JSDOMWindow::btoa): (WebCore::JSDOMWindow::addEventListener): (WebCore::JSDOMWindow::removeEventListener): (WebCore::toDOMWindow):
  • bindings/js/JSDatabaseCustom.cpp: (WebCore::JSDatabase::changeVersion): (WebCore::JSDatabase::transaction):
  • bindings/js/JSDocumentCustom.cpp: (WebCore::JSDocument::setLocation):
  • bindings/js/JSElementCustom.cpp: (WebCore::JSElement::setAttribute): (WebCore::JSElement::setAttributeNS):
  • bindings/js/JSEventListener.cpp: (WebCore::JSAbstractEventListener::handleEvent): (WebCore::JSLazyEventListener::parseCode):
  • bindings/js/JSEventTargetNodeCustom.cpp: (WebCore::JSEventTargetNode::addEventListener): (WebCore::JSEventTargetNode::removeEventListener):
  • bindings/js/JSGeolocationCustom.cpp: (WebCore::createPositionOptions): (WebCore::JSGeolocation::getCurrentPosition): (WebCore::JSGeolocation::watchPosition):
  • bindings/js/JSHTMLCollectionCustom.cpp: (WebCore::callHTMLCollection): (WebCore::JSHTMLCollection::canGetItemsForName): (WebCore::JSHTMLCollection::item): (WebCore::JSHTMLCollection::namedItem):
  • bindings/js/JSHTMLDocumentCustom.cpp: (WebCore::JSHTMLDocument::open): (WebCore::writeHelper):
  • bindings/js/JSHTMLOptionsCollectionCustom.cpp: (WebCore::JSHTMLOptionsCollection::setLength): (WebCore::JSHTMLOptionsCollection::add):
  • bindings/js/JSHTMLSelectElementCustom.cpp: (WebCore::JSHTMLSelectElement::remove): (WebCore::selectIndexSetter):
  • bindings/js/JSImageConstructor.cpp: (WebCore::constructImage):
  • bindings/js/JSInspectedObjectWrapper.cpp: (WebCore::JSInspectedObjectWrapper::wrap): (WebCore::JSInspectedObjectWrapper::prepareIncomingValue):
  • bindings/js/JSInspectorCallbackWrapper.cpp: (WebCore::JSInspectorCallbackWrapper::wrap):
  • bindings/js/JSJavaScriptCallFrameCustom.cpp: (WebCore::JSJavaScriptCallFrame::evaluate):
  • bindings/js/JSLocationCustom.cpp: (WebCore::JSLocation::setHref): (WebCore::JSLocation::setProtocol): (WebCore::JSLocation::setHost): (WebCore::JSLocation::setHostname): (WebCore::JSLocation::setPort): (WebCore::JSLocation::setPathname): (WebCore::JSLocation::setSearch): (WebCore::JSLocation::setHash): (WebCore::JSLocation::replace): (WebCore::JSLocation::assign):
  • bindings/js/JSMessageChannelConstructor.cpp: (WebCore::JSMessageChannelConstructor::mark):
  • bindings/js/JSMessagePortCustom.cpp: (WebCore::JSMessagePort::startConversation): (WebCore::JSMessagePort::addEventListener): (WebCore::JSMessagePort::removeEventListener):
  • bindings/js/JSNodeFilterCondition.cpp: (WebCore::JSNodeFilterCondition::mark): (WebCore::JSNodeFilterCondition::acceptNode):
  • bindings/js/JSNodeFilterCondition.h:
  • bindings/js/JSNodeFilterCustom.cpp: (WebCore::toNodeFilter):
  • bindings/js/JSNodeListCustom.cpp: (WebCore::callNodeList):
  • bindings/js/JSOptionConstructor.cpp: (WebCore::constructHTMLOptionElement):
  • bindings/js/JSQuarantinedObjectWrapper.cpp: (WebCore::JSQuarantinedObjectWrapper::asWrapper): (WebCore::JSQuarantinedObjectWrapper::construct):
  • bindings/js/JSSQLResultSetRowListCustom.cpp: (WebCore::JSSQLResultSetRowList::item):
  • bindings/js/JSSQLTransactionCustom.cpp: (WebCore::JSSQLTransaction::executeSql):
  • bindings/js/JSSVGElementInstanceCustom.cpp: (WebCore::JSSVGElementInstance::addEventListener): (WebCore::JSSVGElementInstance::removeEventListener):
  • bindings/js/JSSVGLengthCustom.cpp: (WebCore::JSSVGLength::convertToSpecifiedUnits):
  • bindings/js/JSSVGMatrixCustom.cpp: (WebCore::JSSVGMatrix::translate): (WebCore::JSSVGMatrix::scale): (WebCore::JSSVGMatrix::scaleNonUniform): (WebCore::JSSVGMatrix::rotate): (WebCore::JSSVGMatrix::rotateFromVector): (WebCore::JSSVGMatrix::skewX): (WebCore::JSSVGMatrix::skewY):
  • bindings/js/JSSVGPathSegListCustom.cpp: (WebCore::JSSVGPathSegList::getItem): (WebCore::JSSVGPathSegList::insertItemBefore): (WebCore::JSSVGPathSegList::replaceItem): (WebCore::JSSVGPathSegList::removeItem):
  • bindings/js/JSSVGPointListCustom.cpp: (WebCore::JSSVGPointList::getItem): (WebCore::JSSVGPointList::insertItemBefore): (WebCore::JSSVGPointList::replaceItem): (WebCore::JSSVGPointList::removeItem):
  • bindings/js/JSSVGTransformListCustom.cpp: (WebCore::JSSVGTransformList::getItem): (WebCore::JSSVGTransformList::insertItemBefore): (WebCore::JSSVGTransformList::replaceItem): (WebCore::JSSVGTransformList::removeItem):
  • bindings/js/JSStorageCustom.cpp: (WebCore::JSStorage::deleteProperty): (WebCore::JSStorage::customPut):
  • bindings/js/JSWebKitCSSMatrixConstructor.cpp: (WebCore::constructWebKitCSSMatrix):
  • bindings/js/JSWorkerConstructor.cpp: (WebCore::constructWorker):
  • bindings/js/JSWorkerContextCustom.cpp: (WebCore::JSWorkerContext::addEventListener): (WebCore::JSWorkerContext::removeEventListener):
  • bindings/js/JSWorkerCustom.cpp: (WebCore::JSWorker::addEventListener): (WebCore::JSWorker::removeEventListener):
  • bindings/js/JSXMLHttpRequestCustom.cpp: (WebCore::JSXMLHttpRequest::open): (WebCore::JSXMLHttpRequest::setRequestHeader): (WebCore::JSXMLHttpRequest::send): (WebCore::JSXMLHttpRequest::getResponseHeader): (WebCore::JSXMLHttpRequest::overrideMimeType): (WebCore::JSXMLHttpRequest::addEventListener): (WebCore::JSXMLHttpRequest::removeEventListener):
  • bindings/js/JSXMLHttpRequestUploadCustom.cpp: (WebCore::JSXMLHttpRequestUpload::addEventListener): (WebCore::JSXMLHttpRequestUpload::removeEventListener):
  • bindings/js/JSXSLTProcessorCustom.cpp: (WebCore::JSXSLTProcessor::importStylesheet): (WebCore::JSXSLTProcessor::transformToFragment): (WebCore::JSXSLTProcessor::transformToDocument): (WebCore::JSXSLTProcessor::setParameter): (WebCore::JSXSLTProcessor::getParameter): (WebCore::JSXSLTProcessor::removeParameter):
  • bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::executeFunctionInContext):
  • bindings/js/ScriptCallStack.cpp: (WebCore::ScriptCallStack::initialize):
  • bindings/js/ScriptController.cpp: (WebCore::ScriptController::createScriptObjectForPluginElement):
  • bindings/js/ScriptValue.cpp: (WebCore::ScriptValue::getString): (WebCore::ScriptValue::isNull): (WebCore::ScriptValue::isUndefined):
  • bindings/objc/WebScriptObject.mm: (-[WebScriptObject callWebScriptMethod:withArguments:]): (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
  • bindings/scripts/CodeGeneratorJS.pm:
  • bridge/NP_jsobject.cpp: (_NPN_InvokeDefault): (_NPN_Invoke): (_NPN_HasMethod): (_NPN_Construct):
  • bridge/c/c_utility.cpp: (JSC::Bindings::convertValueToNPVariant):
  • bridge/jni/jni_instance.cpp: (JavaInstance::invokeMethod):
  • bridge/jni/jni_jsobject.mm: (JavaJSObject::call): (JavaJSObject::convertValueToJObject):
  • bridge/jni/jni_runtime.cpp: (JavaField::dispatchValueFromInstance): (JavaField::valueFromInstance): (JavaField::dispatchSetValueToInstance): (JavaField::setValueToInstance):
  • bridge/jni/jni_utility.cpp: (JSC::Bindings::convertArrayInstanceToJavaArray): (JSC::Bindings::convertValueToJValue):
  • bridge/objc/objc_runtime.mm: (JSC::Bindings::callObjCFallbackObject):
  • bridge/objc/objc_utility.mm: (JSC::Bindings::convertValueToObjcValue):
  • bridge/runtime_method.cpp: (JSC::callRuntimeMethod):
  • bridge/runtime_object.cpp: (JSC::RuntimeObjectImp::getOwnPropertySlot): (JSC::callRuntimeConstructor):

WebKit/mac:

2009-01-19 Sam Weinig <[email protected]>

Rubber-stamped by Gavin Barraclough.

Remove temporary operator-> from JSValuePtr.

  • Plugins/Hosted/NetscapePluginInstanceProxy.mm: (WebKit::NetscapePluginInstanceProxy::invoke): (WebKit::NetscapePluginInstanceProxy::hasMethod): (WebKit::NetscapePluginInstanceProxy::marshalValue):
  • WebView/WebFrame.mm: (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]):
  • WebView/WebView.mm: (aeDescFromJSValue):

WebKit/win:

2009-01-19 Sam Weinig <[email protected]>

Rubber-stamped by Gavin Barraclough.

Remove temporary operator-> from JSValuePtr.

  • WebScriptCallFrame.cpp: (WebScriptCallFrame::jsValueToString):
  • WebView.cpp: (WebView::stringByEvaluatingJavaScriptFromString):

WebKit/wx:

2009-01-19 Sam Weinig <[email protected]>

Rubber-stamped by Gavin Barraclough.

Remove temporary operator-> from JSValuePtr.

  • WebFrame.cpp: (wxWebFrame::RunScript):
  • Property svn:eol-style set to native
File size: 13.4 KB
Line 
1/*
2 * Copyright (C) 1999-2002 Harri Porten ([email protected])
3 * Copyright (C) 2001 Peter Kelly ([email protected])
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Cameron Zwarich ([email protected])
6 * Copyright (C) 2007 Maks Orlovich
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 *
23 */
24
25#include "config.h"
26#include "JSGlobalObjectFunctions.h"
27
28#include "CallFrame.h"
29#include "GlobalEvalFunction.h"
30#include "JSGlobalObject.h"
31#include "JSString.h"
32#include "Interpreter.h"
33#include "Parser.h"
34#include "dtoa.h"
35#include "Lexer.h"
36#include "Nodes.h"
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>
40#include <wtf/ASCIICType.h>
41#include <wtf/Assertions.h>
42#include <wtf/MathExtras.h>
43#include <wtf/unicode/UTF8.h>
44
45using namespace WTF;
46using namespace Unicode;
47
48namespace JSC {
49
50static JSValuePtr encode(ExecState* exec, const ArgList& args, const char* doNotEscape)
51{
52 UString str = args.at(exec, 0).toString(exec);
53 CString cstr = str.UTF8String(true);
54 if (!cstr.c_str())
55 return throwError(exec, URIError, "String contained an illegal UTF-16 sequence.");
56
57 UString result = "";
58 const char* p = cstr.c_str();
59 for (size_t k = 0; k < cstr.size(); k++, p++) {
60 char c = *p;
61 if (c && strchr(doNotEscape, c))
62 result.append(c);
63 else {
64 char tmp[4];
65 sprintf(tmp, "%%%02X", static_cast<unsigned char>(c));
66 result += tmp;
67 }
68 }
69 return jsString(exec, result);
70}
71
72static JSValuePtr decode(ExecState* exec, const ArgList& args, const char* doNotUnescape, bool strict)
73{
74 UString result = "";
75 UString str = args.at(exec, 0).toString(exec);
76 int k = 0;
77 int len = str.size();
78 const UChar* d = str.data();
79 UChar u = 0;
80 while (k < len) {
81 const UChar* p = d + k;
82 UChar c = *p;
83 if (c == '%') {
84 int charLen = 0;
85 if (k <= len - 3 && isASCIIHexDigit(p[1]) && isASCIIHexDigit(p[2])) {
86 const char b0 = Lexer::convertHex(p[1], p[2]);
87 const int sequenceLen = UTF8SequenceLength(b0);
88 if (sequenceLen != 0 && k <= len - sequenceLen * 3) {
89 charLen = sequenceLen * 3;
90 char sequence[5];
91 sequence[0] = b0;
92 for (int i = 1; i < sequenceLen; ++i) {
93 const UChar* q = p + i * 3;
94 if (q[0] == '%' && isASCIIHexDigit(q[1]) && isASCIIHexDigit(q[2]))
95 sequence[i] = Lexer::convertHex(q[1], q[2]);
96 else {
97 charLen = 0;
98 break;
99 }
100 }
101 if (charLen != 0) {
102 sequence[sequenceLen] = 0;
103 const int character = decodeUTF8Sequence(sequence);
104 if (character < 0 || character >= 0x110000)
105 charLen = 0;
106 else if (character >= 0x10000) {
107 // Convert to surrogate pair.
108 result.append(static_cast<UChar>(0xD800 | ((character - 0x10000) >> 10)));
109 u = static_cast<UChar>(0xDC00 | ((character - 0x10000) & 0x3FF));
110 } else
111 u = static_cast<UChar>(character);
112 }
113 }
114 }
115 if (charLen == 0) {
116 if (strict)
117 return throwError(exec, URIError);
118 // The only case where we don't use "strict" mode is the "unescape" function.
119 // For that, it's good to support the wonky "%u" syntax for compatibility with WinIE.
120 if (k <= len - 6 && p[1] == 'u'
121 && isASCIIHexDigit(p[2]) && isASCIIHexDigit(p[3])
122 && isASCIIHexDigit(p[4]) && isASCIIHexDigit(p[5])) {
123 charLen = 6;
124 u = Lexer::convertUnicode(p[2], p[3], p[4], p[5]);
125 }
126 }
127 if (charLen && (u == 0 || u >= 128 || !strchr(doNotUnescape, u))) {
128 c = u;
129 k += charLen - 1;
130 }
131 }
132 k++;
133 result.append(c);
134 }
135 return jsString(exec, result);
136}
137
138bool isStrWhiteSpace(UChar c)
139{
140 switch (c) {
141 case 0x0009:
142 case 0x000A:
143 case 0x000B:
144 case 0x000C:
145 case 0x000D:
146 case 0x0020:
147 case 0x00A0:
148 case 0x2028:
149 case 0x2029:
150 return true;
151 default:
152 return c > 0xff && isSeparatorSpace(c);
153 }
154}
155
156static int parseDigit(unsigned short c, int radix)
157{
158 int digit = -1;
159
160 if (c >= '0' && c <= '9')
161 digit = c - '0';
162 else if (c >= 'A' && c <= 'Z')
163 digit = c - 'A' + 10;
164 else if (c >= 'a' && c <= 'z')
165 digit = c - 'a' + 10;
166
167 if (digit >= radix)
168 return -1;
169 return digit;
170}
171
172double parseIntOverflow(const char* s, int length, int radix)
173{
174 double number = 0.0;
175 double radixMultiplier = 1.0;
176
177 for (const char* p = s + length - 1; p >= s; p--) {
178 if (radixMultiplier == Inf) {
179 if (*p != '0') {
180 number = Inf;
181 break;
182 }
183 } else {
184 int digit = parseDigit(*p, radix);
185 number += digit * radixMultiplier;
186 }
187
188 radixMultiplier *= radix;
189 }
190
191 return number;
192}
193
194static double parseInt(const UString& s, int radix)
195{
196 int length = s.size();
197 const UChar* data = s.data();
198 int p = 0;
199
200 while (p < length && isStrWhiteSpace(data[p]))
201 ++p;
202
203 double sign = 1;
204 if (p < length) {
205 if (data[p] == '+')
206 ++p;
207 else if (data[p] == '-') {
208 sign = -1;
209 ++p;
210 }
211 }
212
213 if ((radix == 0 || radix == 16) && length - p >= 2 && data[p] == '0' && (data[p + 1] == 'x' || data[p + 1] == 'X')) {
214 radix = 16;
215 p += 2;
216 } else if (radix == 0) {
217 if (p < length && data[p] == '0')
218 radix = 8;
219 else
220 radix = 10;
221 }
222
223 if (radix < 2 || radix > 36)
224 return NaN;
225
226 int firstDigitPosition = p;
227 bool sawDigit = false;
228 double number = 0;
229 while (p < length) {
230 int digit = parseDigit(data[p], radix);
231 if (digit == -1)
232 break;
233 sawDigit = true;
234 number *= radix;
235 number += digit;
236 ++p;
237 }
238
239 if (number >= mantissaOverflowLowerBound) {
240 if (radix == 10)
241 number = WTF::strtod(s.substr(firstDigitPosition, p - firstDigitPosition).ascii(), 0);
242 else if (radix == 2 || radix == 4 || radix == 8 || radix == 16 || radix == 32)
243 number = parseIntOverflow(s.substr(firstDigitPosition, p - firstDigitPosition).ascii(), p - firstDigitPosition, radix);
244 }
245
246 if (!sawDigit)
247 return NaN;
248
249 return sign * number;
250}
251
252static double parseFloat(const UString& s)
253{
254 // Check for 0x prefix here, because toDouble allows it, but we must treat it as 0.
255 // Need to skip any whitespace and then one + or - sign.
256 int length = s.size();
257 const UChar* data = s.data();
258 int p = 0;
259 while (p < length && isStrWhiteSpace(data[p]))
260 ++p;
261
262 if (p < length && (data[p] == '+' || data[p] == '-'))
263 ++p;
264
265 if (length - p >= 2 && data[p] == '0' && (data[p + 1] == 'x' || data[p + 1] == 'X'))
266 return 0;
267
268 return s.toDouble(true /*tolerant*/, false /* NaN for empty string */);
269}
270
271JSValuePtr globalFuncEval(ExecState* exec, JSObject* function, JSValuePtr thisValue, const ArgList& args)
272{
273 JSObject* thisObject = thisValue.toThisObject(exec);
274 JSObject* unwrappedObject = thisObject->unwrappedObject();
275 if (!unwrappedObject->isGlobalObject() || static_cast<JSGlobalObject*>(unwrappedObject)->evalFunction() != function)
276 return throwError(exec, EvalError, "The \"this\" value passed to eval must be the global object from which eval originated");
277
278 JSValuePtr x = args.at(exec, 0);
279 if (!x.isString())
280 return x;
281
282 UString s = x.toString(exec);
283
284 int errLine;
285 UString errMsg;
286
287 SourceCode source = makeSource(s);
288 RefPtr<EvalNode> evalNode = exec->globalData().parser->parse<EvalNode>(exec, exec->dynamicGlobalObject()->debugger(), source, &errLine, &errMsg);
289
290 if (!evalNode)
291 return throwError(exec, SyntaxError, errMsg, errLine, source.provider()->asID(), NULL);
292
293 return exec->interpreter()->execute(evalNode.get(), exec, thisObject, static_cast<JSGlobalObject*>(unwrappedObject)->globalScopeChain().node(), exec->exceptionSlot());
294}
295
296JSValuePtr globalFuncParseInt(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
297{
298 JSValuePtr value = args.at(exec, 0);
299 int32_t radix = args.at(exec, 1).toInt32(exec);
300
301 if (value.isNumber() && (radix == 0 || radix == 10)) {
302 if (value.isInt32Fast())
303 return value;
304 double d = value.uncheckedGetNumber();
305 if (isfinite(d))
306 return jsNumber(exec, floor(d));
307 if (isnan(d))
308 return jsNaN(&exec->globalData());
309 return js0();
310 }
311
312 return jsNumber(exec, parseInt(value.toString(exec), radix));
313}
314
315JSValuePtr globalFuncParseFloat(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
316{
317 return jsNumber(exec, parseFloat(args.at(exec, 0).toString(exec)));
318}
319
320JSValuePtr globalFuncIsNaN(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
321{
322 return jsBoolean(isnan(args.at(exec, 0).toNumber(exec)));
323}
324
325JSValuePtr globalFuncIsFinite(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
326{
327 double n = args.at(exec, 0).toNumber(exec);
328 return jsBoolean(!isnan(n) && !isinf(n));
329}
330
331JSValuePtr globalFuncDecodeURI(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
332{
333 static const char do_not_unescape_when_decoding_URI[] =
334 "#$&+,/:;=?@";
335
336 return decode(exec, args, do_not_unescape_when_decoding_URI, true);
337}
338
339JSValuePtr globalFuncDecodeURIComponent(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
340{
341 return decode(exec, args, "", true);
342}
343
344JSValuePtr globalFuncEncodeURI(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
345{
346 static const char do_not_escape_when_encoding_URI[] =
347 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
348 "abcdefghijklmnopqrstuvwxyz"
349 "0123456789"
350 "!#$&'()*+,-./:;=?@_~";
351
352 return encode(exec, args, do_not_escape_when_encoding_URI);
353}
354
355JSValuePtr globalFuncEncodeURIComponent(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
356{
357 static const char do_not_escape_when_encoding_URI_component[] =
358 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
359 "abcdefghijklmnopqrstuvwxyz"
360 "0123456789"
361 "!'()*-._~";
362
363 return encode(exec, args, do_not_escape_when_encoding_URI_component);
364}
365
366JSValuePtr globalFuncEscape(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
367{
368 static const char do_not_escape[] =
369 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
370 "abcdefghijklmnopqrstuvwxyz"
371 "0123456789"
372 "*+-./@_";
373
374 UString result = "";
375 UString s;
376 UString str = args.at(exec, 0).toString(exec);
377 const UChar* c = str.data();
378 for (int k = 0; k < str.size(); k++, c++) {
379 int u = c[0];
380 if (u > 255) {
381 char tmp[7];
382 sprintf(tmp, "%%u%04X", u);
383 s = UString(tmp);
384 } else if (u != 0 && strchr(do_not_escape, static_cast<char>(u)))
385 s = UString(c, 1);
386 else {
387 char tmp[4];
388 sprintf(tmp, "%%%02X", u);
389 s = UString(tmp);
390 }
391 result += s;
392 }
393
394 return jsString(exec, result);
395}
396
397JSValuePtr globalFuncUnescape(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
398{
399 UString result = "";
400 UString str = args.at(exec, 0).toString(exec);
401 int k = 0;
402 int len = str.size();
403 while (k < len) {
404 const UChar* c = str.data() + k;
405 UChar u;
406 if (c[0] == '%' && k <= len - 6 && c[1] == 'u') {
407 if (Lexer::isHexDigit(c[2]) && Lexer::isHexDigit(c[3]) && Lexer::isHexDigit(c[4]) && Lexer::isHexDigit(c[5])) {
408 u = Lexer::convertUnicode(c[2], c[3], c[4], c[5]);
409 c = &u;
410 k += 5;
411 }
412 } else if (c[0] == '%' && k <= len - 3 && Lexer::isHexDigit(c[1]) && Lexer::isHexDigit(c[2])) {
413 u = UChar(Lexer::convertHex(c[1], c[2]));
414 c = &u;
415 k += 2;
416 }
417 k++;
418 result.append(*c);
419 }
420
421 return jsString(exec, result);
422}
423
424#ifndef NDEBUG
425JSValuePtr globalFuncJSCPrint(ExecState* exec, JSObject*, JSValuePtr, const ArgList& args)
426{
427 CStringBuffer string;
428 args.at(exec, 0).toString(exec).getCString(string);
429 puts(string.data());
430 return jsUndefined();
431}
432#endif
433
434} // namespace JSC
Note: See TracBrowser for help on using the repository browser.