本文整理汇总了C++中JSGlobalObject::inspectorController方法的典型用法代码示例。如果您正苦于以下问题:C++ JSGlobalObject::inspectorController方法的具体用法?C++ JSGlobalObject::inspectorController怎么用?C++ JSGlobalObject::inspectorController使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSGlobalObject
的用法示例。
在下文中一共展示了JSGlobalObject::inspectorController方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: JSEvaluateScriptInternal
JSValueRef JSEvaluateScriptInternal(const JSLockHolder&, ExecState* exec, JSContextRef ctx, JSObjectRef thisObject, const SourceCode& source, JSValueRef* exception)
{
UNUSED_PARAM(ctx);
JSObject* jsThisObject = toJS(thisObject);
// evaluate sets "this" to the global object if it is NULL
VM& vm = exec->vm();
JSGlobalObject* globalObject = vm.vmEntryGlobalObject(exec);
NakedPtr<Exception> evaluationException;
JSValue returnValue = profiledEvaluate(globalObject->globalExec(), ProfilingReason::API, source, jsThisObject, evaluationException);
if (evaluationException) {
if (exception)
*exception = toRef(exec, evaluationException->value());
#if ENABLE(REMOTE_INSPECTOR)
// FIXME: If we have a debugger attached we could learn about ParseError exceptions through
// ScriptDebugServer::sourceParsed and this path could produce a duplicate warning. The
// Debugger path is currently ignored by inspector.
// NOTE: If we don't have a debugger, this SourceCode will be forever lost to the inspector.
// We could stash it in the inspector in case an inspector is ever opened.
globalObject->inspectorController().reportAPIException(exec, evaluationException);
#endif
return nullptr;
}
if (returnValue)
return toRef(exec, returnValue);
// happens, for example, when the only statement is an empty (';') statement
return toRef(exec, jsUndefined());
}
示例2: JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions
void JSGlobalContextSetIncludesNativeCallStackWhenReportingExceptions(JSGlobalContextRef ctx, bool includesNativeCallStack)
{
#if ENABLE(REMOTE_INSPECTOR)
if (!ctx) {
ASSERT_NOT_REACHED();
return;
}
ExecState* exec = toJS(ctx);
JSLockHolder lock(exec);
JSGlobalObject* globalObject = exec->vmEntryGlobalObject();
globalObject->inspectorController().setIncludesNativeCallStackWhenReportingExceptions(includesNativeCallStack);
#else
UNUSED_PARAM(ctx);
UNUSED_PARAM(includesNativeCallStack);
#endif
}
示例3: JSEvaluateScript
JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)
{
if (!ctx) {
ASSERT_NOT_REACHED();
return 0;
}
ExecState* exec = toJS(ctx);
JSLockHolder locker(exec);
JSObject* jsThisObject = toJS(thisObject);
startingLineNumber = std::max(1, startingLineNumber);
// evaluate sets "this" to the global object if it is NULL
JSGlobalObject* globalObject = exec->vmEntryGlobalObject();
auto sourceURLString = sourceURL ? sourceURL->string() : String();
SourceCode source = makeSource(script->string(), SourceOrigin { sourceURLString }, sourceURLString, TextPosition(OrdinalNumber::fromOneBasedInt(startingLineNumber), OrdinalNumber()));
NakedPtr<Exception> evaluationException;
JSValue returnValue = profiledEvaluate(globalObject->globalExec(), ProfilingReason::API, source, jsThisObject, evaluationException);
if (evaluationException) {
if (exception)
*exception = toRef(exec, evaluationException->value());
#if ENABLE(REMOTE_INSPECTOR)
// FIXME: If we have a debugger attached we could learn about ParseError exceptions through
// ScriptDebugServer::sourceParsed and this path could produce a duplicate warning. The
// Debugger path is currently ignored by inspector.
// NOTE: If we don't have a debugger, this SourceCode will be forever lost to the inspector.
// We could stash it in the inspector in case an inspector is ever opened.
globalObject->inspectorController().reportAPIException(exec, evaluationException);
#endif
return 0;
}
if (returnValue)
return toRef(exec, returnValue);
// happens, for example, when the only statement is an empty (';') statement
return toRef(exec, jsUndefined());
}