static v8::Handle<v8::Value> parseFromStringCallback(const v8::Arguments& args) { INC_STATS("DOM.DOMParser.parseFromString"); DOMParser* imp = V8DOMParser::toNative(args.Holder()); V8Parameter<> str = args[0]; V8Parameter<> contentType = args[1]; return toV8(imp->parseFromString(str, contentType)); }
JSValue* jsDOMParserPrototypeFunctionParseFromString(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args) { if (!thisValue->isObject(&JSDOMParser::s_info)) return throwError(exec, TypeError); JSDOMParser* castedThisObj = static_cast<JSDOMParser*>(thisValue); DOMParser* imp = static_cast<DOMParser*>(castedThisObj->impl()); const UString& str = args[0]->toString(exec); const UString& contentType = args[1]->toString(exec); KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->parseFromString(str, contentType))); return result; }
EncodedJSValue JSC_HOST_CALL jsDOMParserPrototypeFunctionParseFromString(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSDOMParser::s_info)) return throwVMTypeError(exec); JSDOMParser* castedThis = static_cast<JSDOMParser*>(asObject(thisValue)); DOMParser* imp = static_cast<DOMParser*>(castedThis->impl()); const String& str(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& contentType(ustringToString(exec->argument(1).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->parseFromString(str, contentType))); return JSValue::encode(result); }