本文整理汇总了C++中ExecState::globalThisValue方法的典型用法代码示例。如果您正苦于以下问题:C++ ExecState::globalThisValue方法的具体用法?C++ ExecState::globalThisValue怎么用?C++ ExecState::globalThisValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExecState
的用法示例。
在下文中一共展示了ExecState::globalThisValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JSObjectCallAsFunction
JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
ExecState* exec = toJS(ctx);
APIEntryShim entryShim(exec);
JSObject* jsObject = toJS(object);
JSObject* jsThisObject = toJS(thisObject);
if (!jsThisObject)
jsThisObject = exec->globalThisValue();
MarkedArgumentBuffer argList;
for (size_t i = 0; i < argumentCount; i++)
argList.append(toJS(exec, arguments[i]));
CallData callData;
CallType callType = jsObject->methodTable()->getCallData(jsObject, callData);
if (callType == CallTypeNone)
return 0;
JSValueRef result = toRef(exec, call(exec, jsObject, callType, callData, jsThisObject, argList));
if (exec->hadException()) {
if (exception)
*exception = toRef(exec, exec->exception());
exec->clearException();
result = 0;
}
return result;
}
示例2: JSObjectCallAsFunction
JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
ExecState* exec = toJS(ctx);
JSLockHolder locker(exec);
if (!object)
return 0;
JSObject* jsObject = toJS(object);
JSObject* jsThisObject = toJS(thisObject);
if (!jsThisObject)
jsThisObject = exec->globalThisValue();
MarkedArgumentBuffer argList;
for (size_t i = 0; i < argumentCount; i++)
argList.append(toJS(exec, arguments[i]));
CallData callData;
CallType callType = jsObject->methodTable()->getCallData(jsObject, callData);
if (callType == CallTypeNone)
return 0;
JSValueRef result = toRef(exec, profiledCall(exec, ProfilingReason::API, jsObject, callType, callData, jsThisObject, argList));
if (handleExceptionIfNeeded(exec, exception) == ExceptionStatus::DidThrow)
result = 0;
return result;
}
示例3: JSObjectCallAsFunction
JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
ExecState* exec = toJS(ctx);
exec->globalData().heap->registerThread();
JSLock lock(exec);
JSObject* jsObject = toJS(object);
JSObject* jsThisObject = toJS(thisObject);
if (!jsThisObject)
jsThisObject = exec->globalThisValue();
ArgList argList;
for (size_t i = 0; i < argumentCount; i++)
argList.append(toJS(arguments[i]));
CallData callData;
CallType callType = jsObject->getCallData(callData);
if (callType == CallTypeNone)
return 0;
JSValueRef result = toRef(call(exec, jsObject, callType, callData, jsThisObject, argList));
if (exec->hadException()) {
if (exception)
*exception = toRef(exec->exception());
exec->clearException();
result = 0;
}
return result;
}
示例4: JSObjectCallAsFunction
JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
ExecState* exec = toJS(ctx);
JSLockHolder locker(exec);
if (!object)
return 0;
JSObject* jsObject = toJS(object);
JSObject* jsThisObject = toJS(thisObject);
if (!jsThisObject)
jsThisObject = exec->globalThisValue();
MarkedArgumentBuffer argList;
for (size_t i = 0; i < argumentCount; i++)
argList.append(toJS(exec, arguments[i]));
CallData callData;
CallType callType = jsObject->methodTable()->getCallData(jsObject, callData);
if (callType == CallTypeNone)
return 0;
JSValueRef result = toRef(exec, call(exec, jsObject, callType, callData, jsThisObject, argList));
if (exec->hadException()) {
JSValue exceptionValue = exec->exception();
if (exception)
*exception = toRef(exec, exceptionValue);
exec->clearException();
#if ENABLE(REMOTE_INSPECTOR)
exec->vmEntryGlobalObject()->inspectorController().reportAPIException(exec, exceptionValue);
#endif
result = 0;
}
return result;
}
示例5: JSObjectCallAsFunction
JSValueRef JSObjectCallAsFunction(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
ExecState* exec = toJS(ctx);
VM& vm = exec->vm();
JSLockHolder locker(vm);
auto scope = DECLARE_CATCH_SCOPE(vm);
if (!object)
return 0;
JSObject* jsObject = toJS(object);
JSObject* jsThisObject = toJS(thisObject);
if (!jsThisObject)
jsThisObject = exec->globalThisValue();
MarkedArgumentBuffer argList;
for (size_t i = 0; i < argumentCount; i++)
argList.append(toJS(exec, arguments[i]));
if (UNLIKELY(argList.hasOverflowed())) {
auto throwScope = DECLARE_THROW_SCOPE(vm);
throwOutOfMemoryError(exec, throwScope);
handleExceptionIfNeeded(scope, exec, exception);
return 0;
}
CallData callData;
CallType callType = jsObject->methodTable(vm)->getCallData(jsObject, callData);
if (callType == CallType::None)
return 0;
JSValueRef result = toRef(exec, profiledCall(exec, ProfilingReason::API, jsObject, callType, callData, jsThisObject, argList));
if (handleExceptionIfNeeded(scope, exec, exception) == ExceptionStatus::DidThrow)
result = 0;
return result;
}