您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ throwVMError函数代码示例

51自学网 2021-06-03 08:49:27
  C++
这篇教程C++ throwVMError函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中throwVMError函数的典型用法代码示例。如果您正苦于以下问题:C++ throwVMError函数的具体用法?C++ throwVMError怎么用?C++ throwVMError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了throwVMError函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: getMap

ALWAYS_INLINE static JSMap* getMap(CallFrame* callFrame, JSValue thisValue){    VM& vm = callFrame->vm();    auto scope = DECLARE_THROW_SCOPE(vm);    if (UNLIKELY(!thisValue.isCell())) {        throwVMError(callFrame, scope, createNotAnObjectError(callFrame, thisValue));        return nullptr;    }    auto* map = jsDynamicCast<JSMap*>(vm, thisValue.asCell());    if (LIKELY(map))        return map;    throwTypeError(callFrame, scope, "Map operation called on non-Map object"_s);    return nullptr;}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:16,


示例2: jsTestOverridingNameGetterPrototypeFunctionAnotherFunction

EncodedJSValue JSC_HOST_CALL jsTestOverridingNameGetterPrototypeFunctionAnotherFunction(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSTestOverridingNameGetter::s_info))        return throwVMTypeError(exec);    JSTestOverridingNameGetter* castedThis = static_cast<JSTestOverridingNameGetter*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestOverridingNameGetter::s_info);    TestOverridingNameGetter* impl = static_cast<TestOverridingNameGetter*>(castedThis->impl());    if (exec->argumentCount() < 1)        return throwVMError(exec, createTypeError(exec, "Not enough arguments"));    const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)->value(exec)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    impl->anotherFunction(str);    return JSValue::encode(jsUndefined());}
开发者ID:sohocoke,项目名称:webkit,代码行数:16,


示例3: jsMessagePortPrototypeFunctionRemoveEventListener

EncodedJSValue JSC_HOST_CALL jsMessagePortPrototypeFunctionRemoveEventListener(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSMessagePort::s_info))        return throwVMTypeError(exec);    JSMessagePort* castedThis = static_cast<JSMessagePort*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSMessagePort::s_info);    MessagePort* imp = static_cast<MessagePort*>(castedThis->impl());    if (exec->argumentCount() < 2)        return throwVMError(exec, createTypeError(exec, "Not enough arguments"));    JSValue listener = exec->argument(1);    if (!listener.isObject())        return JSValue::encode(jsUndefined());    imp->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));    return JSValue::encode(jsUndefined());}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:16,


示例4: objectConstructorDefineProperty

EncodedJSValue JSC_HOST_CALL objectConstructorDefineProperty(ExecState* exec){    if (!exec->argument(0).isObject())        return throwVMError(exec, createTypeError(exec, ASCIILiteral("Properties can only be defined on Objects.")));    JSObject* O = asObject(exec->argument(0));    String propertyName = exec->argument(1).toString(exec)->value(exec);    if (exec->hadException())        return JSValue::encode(jsNull());    PropertyDescriptor descriptor;    if (!toPropertyDescriptor(exec, exec->argument(2), descriptor))        return JSValue::encode(jsNull());    ASSERT((descriptor.attributes() & Accessor) || (!descriptor.isAccessorDescriptor()));    ASSERT(!exec->hadException());    O->methodTable(exec->vm())->defineOwnProperty(O, exec, Identifier(exec, propertyName), descriptor, true);    return JSValue::encode(O);}
开发者ID:CannedFish,项目名称:webkit,代码行数:16,


示例5: jsTestCustomNamedGetterPrototypeFunctionAnotherFunction

EncodedJSValue JSC_HOST_CALL jsTestCustomNamedGetterPrototypeFunctionAnotherFunction(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSTestCustomNamedGetter::s_info))        return throwVMTypeError(exec);    JSTestCustomNamedGetter* castedThis = jsCast<JSTestCustomNamedGetter*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestCustomNamedGetter::s_info);    TestCustomNamedGetter* impl = static_cast<TestCustomNamedGetter*>(castedThis->impl());    if (exec->argumentCount() < 1)        return throwVMError(exec, createNotEnoughArgumentsError(exec));    const String& str(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));    if (exec->hadException())        return JSValue::encode(jsUndefined());    impl->anotherFunction(str);    return JSValue::encode(jsUndefined());}
开发者ID:harlanlewis,项目名称:webkit,代码行数:16,


示例6: jsHTMLKeygenElementPrototypeFunctionSetCustomValidity

EncodedJSValue JSC_HOST_CALL jsHTMLKeygenElementPrototypeFunctionSetCustomValidity(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSHTMLKeygenElement::s_info))        return throwVMTypeError(exec);    JSHTMLKeygenElement* castedThis = static_cast<JSHTMLKeygenElement*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLKeygenElement::s_info);    HTMLKeygenElement* imp = static_cast<HTMLKeygenElement*>(castedThis->impl());    if (exec->argumentCount() < 1)        return throwVMError(exec, createTypeError(exec, "Not enough arguments"));    const String& error(valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    imp->setCustomValidity(error);    return JSValue::encode(jsUndefined());}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:17,


示例7: jsAudioBufferSourceNodePrototypeFunctionNoteOff

EncodedJSValue JSC_HOST_CALL jsAudioBufferSourceNodePrototypeFunctionNoteOff(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSAudioBufferSourceNode::s_info))        return throwVMTypeError(exec);    JSAudioBufferSourceNode* castedThis = static_cast<JSAudioBufferSourceNode*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSAudioBufferSourceNode::s_info);    AudioBufferSourceNode* imp = static_cast<AudioBufferSourceNode*>(castedThis->impl());    if (exec->argumentCount() < 1)        return throwVMError(exec, createTypeError(exec, "Not enough arguments"));    float when(exec->argument(0).toFloat(exec));    if (exec->hadException())        return JSValue::encode(jsUndefined());    imp->noteOff(when);    return JSValue::encode(jsUndefined());}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:17,


示例8: jsDOMNamedFlowCollectionPrototypeFunctionItem

EncodedJSValue JSC_HOST_CALL jsDOMNamedFlowCollectionPrototypeFunctionItem(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    JSDOMNamedFlowCollection* castedThis = jsDynamicCast<JSDOMNamedFlowCollection*>(thisValue);    if (!castedThis)        return throwVMTypeError(exec);    ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMNamedFlowCollection::info());    DOMNamedFlowCollection& impl = castedThis->impl();    if (exec->argumentCount() < 1)        return throwVMError(exec, createNotEnoughArgumentsError(exec));    unsigned index(toUInt32(exec, exec->argument(0), NormalConversion));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.item(index)));    return JSValue::encode(result);}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:17,


示例9: jsDOMNamedFlowCollectionPrototypeFunctionNamedItem

EncodedJSValue JSC_HOST_CALL jsDOMNamedFlowCollectionPrototypeFunctionNamedItem(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    JSDOMNamedFlowCollection* castedThis = jsDynamicCast<JSDOMNamedFlowCollection*>(thisValue);    if (!castedThis)        return throwVMTypeError(exec);    ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMNamedFlowCollection::info());    DOMNamedFlowCollection& impl = castedThis->impl();    if (exec->argumentCount() < 1)        return throwVMError(exec, createNotEnoughArgumentsError(exec));    const String& name(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.namedItem(name)));    return JSValue::encode(result);}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:17,


示例10: DECLARE_THROW_SCOPE

template<> EncodedJSValue JSC_HOST_CALL JSTestPromiseRejectionEventConstructor::construct(ExecState* state){    VM& vm = state->vm();    auto throwScope = DECLARE_THROW_SCOPE(vm);    UNUSED_PARAM(throwScope);    auto* castedThis = jsCast<JSTestPromiseRejectionEventConstructor*>(state->jsCallee());    ASSERT(castedThis);    if (UNLIKELY(state->argumentCount() < 2))        return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));    auto type = convert<IDLDOMString>(*state, state->uncheckedArgument(0));    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());    auto eventInitDict = convert<IDLDictionary<TestPromiseRejectionEvent::Init>>(*state, state->uncheckedArgument(1));    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());    auto object = TestPromiseRejectionEvent::create(*state, WTFMove(type), WTFMove(eventInitDict));    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestPromiseRejectionEvent>>(*state, *castedThis->globalObject(), WTFMove(object)));}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:17,


示例11: throwVMError

EncodedJSValue JSC_HOST_CALL JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface(ExecState* exec){    JSTestSerializedScriptValueInterfaceConstructor* castedThis = jsCast<JSTestSerializedScriptValueInterfaceConstructor*>(exec->callee());    if (exec->argumentCount() < 2)        return throwVMError(exec, createNotEnoughArgumentsError(exec));    const String& hello(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).isEmpty() ? String() : MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined).toString(exec)->value(exec));    if (exec->hadException())        return JSValue::encode(jsUndefined());    RefPtr<SerializedScriptValue> data(SerializedScriptValue::create(exec, MAYBE_MISSING_PARAMETER(exec, 1, DefaultIsUndefined), 0, 0));    if (exec->hadException())        return JSValue::encode(jsUndefined());    Array* transferList(toArray(MAYBE_MISSING_PARAMETER(exec, 2, DefaultIsUndefined)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    RefPtr<TestSerializedScriptValueInterface> object = TestSerializedScriptValueInterface::create(hello, data, transferList);    return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get())));}
开发者ID:yoavweiss,项目名称:RespImg-WebKit,代码行数:17,


示例12: constructJSMutationObserver

EncodedJSValue JSC_HOST_CALL constructJSMutationObserver(ExecState& exec){    if (exec.argumentCount() < 1)        return throwVMError(&exec, createNotEnoughArgumentsError(&exec));    JSObject* object = exec.uncheckedArgument(0).getObject();    CallData callData;    if (!object || object->methodTable()->getCallData(object, callData) == CallType::None)        return throwVMTypeError(&exec, ASCIILiteral("Callback argument must be a function"));    DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec.callee());    auto callback = JSMutationCallback::create(object, jsConstructor->globalObject());    JSObject* jsObserver = asObject(toJSNewlyCreated(&exec, jsConstructor->globalObject(), MutationObserver::create(WTFMove(callback))));    PrivateName propertyName;    jsObserver->putDirect(jsConstructor->globalObject()->vm(), propertyName, object);    return JSValue::encode(jsObserver);}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:17,


示例13: jsFloat64ArrayPrototypeFunctionFoo

EncodedJSValue JSC_HOST_CALL jsFloat64ArrayPrototypeFunctionFoo(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSFloat64Array::s_info))        return throwVMTypeError(exec);    JSFloat64Array* castedThis = jsCast<JSFloat64Array*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSFloat64Array::s_info);    Float64Array* impl = static_cast<Float64Array*>(castedThis->impl());    if (exec->argumentCount() < 1)        return throwVMError(exec, createNotEnoughArgumentsError(exec));    Float32Array* array(toFloat32Array(exec->argument(0)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->foo(array)));    return JSValue::encode(result);}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:17,


示例14: jsTouchListPrototypeFunctionItem

EncodedJSValue JSC_HOST_CALL jsTouchListPrototypeFunctionItem(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSTouchList::s_info))        return throwVMTypeError(exec);    JSTouchList* castedThis = static_cast<JSTouchList*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTouchList::s_info);    TouchList* imp = static_cast<TouchList*>(castedThis->impl());    if (exec->argumentCount() < 1)        return throwVMError(exec, createTypeError(exec, "Not enough arguments"));    unsigned index(exec->argument(0).toUInt32(exec));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->item(index)));    return JSValue::encode(result);}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:18,


示例15: hasDebugger

UnlinkedEvalCodeBlock* JSGlobalObject::createEvalCodeBlock(CallFrame* callFrame, EvalExecutable* executable){    ParserError error;    JSParserStrictness strictness = executable->isStrictMode() ? JSParseStrict : JSParseNormal;    DebuggerMode debuggerMode = hasDebugger() ? DebuggerOn : DebuggerOff;    ProfilerMode profilerMode = hasProfiler() ? ProfilerOn : ProfilerOff;    UnlinkedEvalCodeBlock* unlinkedCodeBlock = vm().codeCache()->getEvalCodeBlock(vm(), executable, executable->source(), strictness, debuggerMode, profilerMode, error);    if (hasDebugger())        debugger()->sourceParsed(callFrame, executable->source().provider(), error.m_line, error.m_message);    if (error.m_type != ParserError::ErrorNone) {        throwVMError(callFrame, error.toErrorObject(this, executable->source()));        return 0;    }    return unlinkedCodeBlock;}
开发者ID:WebKitNix,项目名称:webkitnix,代码行数:18,


示例16: operationResolveGlobal

EncodedJSValue DFG_OPERATION operationResolveGlobal(ExecState* exec, GlobalResolveInfo* resolveInfo, Identifier* propertyName){    JSGlobalObject* globalObject = exec->lexicalGlobalObject();    PropertySlot slot(globalObject);    if (globalObject->getPropertySlot(exec, *propertyName, slot)) {        JSValue result = slot.getValue(exec, *propertyName);        if (slot.isCacheableValue() && !globalObject->structure()->isUncacheableDictionary() && slot.slotBase() == globalObject) {            resolveInfo->structure.set(exec->globalData(), exec->codeBlock()->ownerExecutable(), globalObject->structure());            resolveInfo->offset = slot.cachedOffset();        }        return JSValue::encode(result);    }    return throwVMError(exec, createUndefinedVariableError(exec, *propertyName));}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:18,


示例17: setData

EncodedJSValue setData(ExecState* exec){    VM& vm = exec->vm();    auto scope = DECLARE_THROW_SCOPE(vm);    JSDataView* dataView = jsDynamicCast<JSDataView*>(exec->thisValue());    if (!dataView)        return throwVMTypeError(exec, scope, ASCIILiteral("Receiver of DataView method must be a DataView"));        unsigned byteOffset = exec->argument(0).toIndex(exec, "byteOffset");    RETURN_IF_EXCEPTION(scope, encodedJSValue());    const unsigned dataSize = sizeof(typename Adaptor::Type);    union {        typename Adaptor::Type value;        uint8_t rawBytes[dataSize];    } u;    u.value = toNativeFromValue<Adaptor>(exec, exec->argument(1));    RETURN_IF_EXCEPTION(scope, encodedJSValue());        bool littleEndian = false;    unsigned elementSize = sizeof(typename Adaptor::Type);    if (elementSize > 1 && exec->argumentCount() >= 3) {        littleEndian = exec->uncheckedArgument(2).toBoolean(exec);        RETURN_IF_EXCEPTION(scope, encodedJSValue());    }        unsigned byteLength = dataView->length();    if (elementSize > byteLength || byteOffset > byteLength - elementSize)        return throwVMError(exec, scope, createRangeError(exec, ASCIILiteral("Out of bounds access")));    uint8_t* dataPtr = static_cast<uint8_t*>(dataView->vector()) + byteOffset;    if (needToFlipBytesIfLittleEndian(littleEndian)) {        for (unsigned i = dataSize; i--;)            *dataPtr++ = u.rawBytes[i];    } else {        for (unsigned i = 0; i < dataSize; i++)            *dataPtr++ = u.rawBytes[i];    }    return JSValue::encode(jsUndefined());}
开发者ID:eocanha,项目名称:webkit,代码行数:44,


示例18: objectProtoFuncDefineSetter

EncodedJSValue JSC_HOST_CALL objectProtoFuncDefineSetter(ExecState* exec){    JSObject* thisObject = exec->thisValue().toThis(exec, StrictMode).toObject(exec);    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSValue set = exec->argument(1);    CallData callData;    if (getCallData(set, callData) == CallTypeNone)        return throwVMError(exec, createTypeError(exec, ASCIILiteral("invalid setter usage")));    PropertyDescriptor descriptor;    descriptor.setSetter(set);    descriptor.setEnumerable(true);    descriptor.setConfigurable(true);    thisObject->methodTable(exec->vm())->defineOwnProperty(thisObject, exec, exec->argument(0).toString(exec)->toIdentifier(exec), descriptor, false);    return JSValue::encode(jsUndefined());}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:19,


示例19: jsSVGStringListPrototypeFunctionAppendItem

EncodedJSValue JSC_HOST_CALL jsSVGStringListPrototypeFunctionAppendItem(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    JSSVGStringList* castedThis = jsDynamicCast<JSSVGStringList*>(thisValue);    if (!castedThis)        return throwVMTypeError(exec);    ASSERT_GC_OBJECT_INHERITS(castedThis, JSSVGStringList::info());    SVGStaticListPropertyTearOff<SVGStringList> & impl = castedThis->impl();    if (exec->argumentCount() < 1)        return throwVMError(exec, createNotEnoughArgumentsError(exec));    ExceptionCode ec = 0;    const String& item(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = jsStringWithCache(exec, impl.appendItem(item, ec));    setDOMException(exec, ec);    return JSValue::encode(result);}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:19,


示例20: jsSVGStringListPrototypeFunctionRemoveItem

EncodedJSValue JSC_HOST_CALL jsSVGStringListPrototypeFunctionRemoveItem(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    JSSVGStringList* castedThis = jsDynamicCast<JSSVGStringList*>(thisValue);    if (!castedThis)        return throwVMTypeError(exec);    ASSERT_GC_OBJECT_INHERITS(castedThis, JSSVGStringList::info());    SVGStaticListPropertyTearOff<SVGStringList> & impl = castedThis->impl();    if (exec->argumentCount() < 1)        return throwVMError(exec, createNotEnoughArgumentsError(exec));    ExceptionCode ec = 0;    unsigned index(toUInt32(exec, exec->argument(0), NormalConversion));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = jsStringWithCache(exec, impl.removeItem(index, ec));    setDOMException(exec, ec);    return JSValue::encode(result);}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:19,


示例21: throwVMError

JSDataView* JSDataView::create(    ExecState* exec, Structure* structure, PassRefPtr<ArrayBuffer> passedBuffer,    unsigned byteOffset, unsigned byteLength){    RefPtr<ArrayBuffer> buffer = passedBuffer;    if (!ArrayBufferView::verifySubRange<uint8_t>(buffer, byteOffset, byteLength)) {        throwVMError(            exec, createRangeError(exec, "Byte offset and length out of range of buffer"));        return 0;    }    VM& vm = exec->vm();    ConstructionContext context(        structure, buffer, byteOffset, byteLength, ConstructionContext::DataView);    ASSERT(context);    JSDataView* result =        new (NotNull, allocateCell<JSDataView>(vm.heap)) JSDataView(vm, context, buffer.get());    result->finishCreation(vm);    return result;}
开发者ID:CannedFish,项目名称:webkit,代码行数:19,


示例22: jsSVGColorPrototypeFunctionSetRGBColor

EncodedJSValue JSC_HOST_CALL jsSVGColorPrototypeFunctionSetRGBColor(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSSVGColor::s_info))        return throwVMTypeError(exec);    JSSVGColor* castedThis = static_cast<JSSVGColor*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGColor::s_info);    SVGColor* imp = static_cast<SVGColor*>(castedThis->impl());    if (exec->argumentCount() < 1)        return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));    ExceptionCode ec = 0;    const String& rgbColor(ustringToString(exec->argument(0).toString(exec)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    imp->setRGBColor(rgbColor, ec);    setDOMException(exec, ec);    return JSValue::encode(jsUndefined());}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:19,


示例23: jsTestEventTargetPrototypeFunctionDispatchEvent

EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionDispatchEvent(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSTestEventTarget::s_info))        return throwVMTypeError(exec);    JSTestEventTarget* castedThis = jsCast<JSTestEventTarget*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestEventTarget::s_info);    TestEventTarget* impl = static_cast<TestEventTarget*>(castedThis->impl());    if (exec->argumentCount() < 1)        return throwVMError(exec, createNotEnoughArgumentsError(exec));    ExceptionCode ec = 0;    Event* evt(toEvent(MAYBE_MISSING_PARAMETER(exec, 0, DefaultIsUndefined)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = jsBoolean(impl->dispatchEvent(evt, ec));    setDOMException(exec, ec);    return JSValue::encode(result);}
开发者ID:dzhshf,项目名称:WebKit,代码行数:19,


示例24: jsMessagePortPrototypeFunctionDispatchEvent

EncodedJSValue JSC_HOST_CALL jsMessagePortPrototypeFunctionDispatchEvent(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSMessagePort::s_info))        return throwVMTypeError(exec);    JSMessagePort* castedThis = static_cast<JSMessagePort*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSMessagePort::s_info);    MessagePort* imp = static_cast<MessagePort*>(castedThis->impl());    if (exec->argumentCount() < 1)        return throwVMError(exec, createTypeError(exec, "Not enough arguments"));    ExceptionCode ec = 0;    Event* evt(toEvent(exec->argument(0)));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = jsBoolean(imp->dispatchEvent(evt, ec));    setDOMException(exec, ec);    return JSValue::encode(result);}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:20,


示例25: constructJSMutationObserver

EncodedJSValue JSC_HOST_CALL constructJSMutationObserver(ExecState& exec){    VM& vm = exec.vm();    auto scope = DECLARE_THROW_SCOPE(vm);    if (exec.argumentCount() < 1)        return throwVMError(&exec, scope, createNotEnoughArgumentsError(&exec));    JSObject* object = exec.uncheckedArgument(0).getObject();    CallData callData;    if (!object || object->methodTable()->getCallData(object, callData) == CallType::None)        return throwArgumentTypeError(exec, scope, 0, "callback", "MutationObserver", nullptr, "MutationCallback");    DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec.jsCallee());    auto callback = JSMutationCallback::create(object, jsConstructor->globalObject());    JSObject* jsObserver = asObject(toJSNewlyCreated(&exec, jsConstructor->globalObject(), MutationObserver::create(WTFMove(callback))));    PrivateName propertyName;    jsObserver->putDirect(vm, propertyName, object);    return JSValue::encode(jsObserver);}
开发者ID:eocanha,项目名称:webkit,代码行数:20,


示例26: jsSVGNumberListPrototypeFunctionRemoveItem

EncodedJSValue JSC_HOST_CALL jsSVGNumberListPrototypeFunctionRemoveItem(ExecState* exec){    JSValue thisValue = exec->hostThisValue();    if (!thisValue.inherits(&JSSVGNumberList::s_info))        return throwVMTypeError(exec);    JSSVGNumberList* castedThis = static_cast<JSSVGNumberList*>(asObject(thisValue));    ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGNumberList::s_info);    SVGListPropertyTearOff<SVGNumberList> * imp = static_cast<SVGListPropertyTearOff<SVGNumberList> *>(castedThis->impl());    if (exec->argumentCount() < 1)        return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));    ExceptionCode ec = 0;    unsigned index(exec->argument(0).toUInt32(exec));    if (exec->hadException())        return JSValue::encode(jsUndefined());    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->removeItem(index, ec)));    setDOMException(exec, ec);    return JSValue::encode(result);}
开发者ID:mulriple,项目名称:Webkit-Projects,代码行数:20,


示例27: getPropertyFromObject

JSPromise* ReadableJSStream::invoke(ExecState& state, const char* propertyName, JSValue parameter){    JSValue function = getPropertyFromObject(state, *m_source.get(), propertyName);    if (state.hadException())        return nullptr;    if (!function.isFunction()) {        if (!function.isUndefined())            throwVMError(&state, createTypeError(&state, ASCIILiteral("ReadableStream trying to call a property that is not callable")));        return nullptr;    }    MarkedArgumentBuffer arguments;    arguments.append(parameter);    JSPromise* promise = jsDynamicCast<JSPromise*>(callFunction(state, function, m_source.get(), arguments));    ASSERT(!(promise && state.hadException()));    return promise;}
开发者ID:GuoCheng111,项目名称:webkit,代码行数:20,



注:本文中的throwVMError函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ throwVMTypeError函数代码示例
C++ throwUnexpected函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。