本文整理汇总了C++中JSGlobalObject::evalDisabledErrorMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ JSGlobalObject::evalDisabledErrorMessage方法的具体用法?C++ JSGlobalObject::evalDisabledErrorMessage怎么用?C++ JSGlobalObject::evalDisabledErrorMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSGlobalObject
的用法示例。
在下文中一共展示了JSGlobalObject::evalDisabledErrorMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: compileInternal
JSObject* EvalExecutable::compileInternal(ExecState* exec, JSScope* scope, JITCode::JITType jitType, unsigned bytecodeIndex)
{
SamplingRegion samplingRegion(samplingDescription(jitType));
#if !ENABLE(JIT)
UNUSED_PARAM(jitType);
UNUSED_PARAM(bytecodeIndex);
#endif
JSGlobalData* globalData = &exec->globalData();
JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject();
if (!!m_evalCodeBlock) {
OwnPtr<EvalCodeBlock> newCodeBlock = adoptPtr(new EvalCodeBlock(CodeBlock::CopyParsedBlock, *m_evalCodeBlock));
newCodeBlock->setAlternative(static_pointer_cast<CodeBlock>(m_evalCodeBlock.release()));
m_evalCodeBlock = newCodeBlock.release();
} else {
UNUSED_PARAM(scope);
UNUSED_PARAM(globalData);
UNUSED_PARAM(lexicalGlobalObject);
if (!lexicalGlobalObject->evalEnabled())
return throwError(exec, createEvalError(exec, lexicalGlobalObject->evalDisabledErrorMessage()));
JSObject* exception = 0;
UnlinkedEvalCodeBlock* unlinkedEvalCode = lexicalGlobalObject->createEvalCodeBlock(exec, this, &exception);
if (!unlinkedEvalCode)
return exception;
OwnPtr<CodeBlock> previousCodeBlock = m_evalCodeBlock.release();
ASSERT((jitType == JITCode::bottomTierJIT()) == !previousCodeBlock);
m_unlinkedEvalCodeBlock.set(*globalData, this, unlinkedEvalCode);
m_evalCodeBlock = adoptPtr(new EvalCodeBlock(this, unlinkedEvalCode, lexicalGlobalObject, source().provider(), scope->localDepth(), previousCodeBlock.release()));
m_evalCodeBlock->copyPostParseDataFromAlternative();
}
#if ENABLE(JIT)
if (!prepareForExecution(exec, m_evalCodeBlock, m_jitCodeForCall, jitType, bytecodeIndex))
return 0;
#endif
#if ENABLE(JIT)
Heap::heap(this)->reportExtraMemoryCost(sizeof(*m_evalCodeBlock) + m_jitCodeForCall.size());
#else
Heap::heap(this)->reportExtraMemoryCost(sizeof(*m_evalCodeBlock));
#endif
return 0;
}
示例2: create
EvalExecutable* EvalExecutable::create(ExecState* exec, const SourceCode& source, bool isInStrictContext, ThisTDZMode thisTDZMode, const VariableEnvironment* variablesUnderTDZ)
{
JSGlobalObject* globalObject = exec->lexicalGlobalObject();
if (!globalObject->evalEnabled()) {
exec->vm().throwException(exec, createEvalError(exec, globalObject->evalDisabledErrorMessage()));
return 0;
}
EvalExecutable* executable = new (NotNull, allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext);
executable->finishCreation(exec->vm());
UnlinkedEvalCodeBlock* unlinkedEvalCode = globalObject->createEvalCodeBlock(exec, executable, thisTDZMode, variablesUnderTDZ);
if (!unlinkedEvalCode)
return 0;
executable->m_unlinkedEvalCodeBlock.set(exec->vm(), executable, unlinkedEvalCode);
return executable;
}
示例3: create
EvalExecutable* EvalExecutable::create(ExecState* exec, const SourceCode& source, bool isInStrictContext, DerivedContextType derivedContextType, bool isArrowFunctionContext, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
{
VM& vm = exec->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
JSGlobalObject* globalObject = exec->lexicalGlobalObject();
if (!globalObject->evalEnabled()) {
throwException(exec, scope, createEvalError(exec, globalObject->evalDisabledErrorMessage()));
return 0;
}
EvalExecutable* executable = new (NotNull, allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext, derivedContextType, isArrowFunctionContext, evalContextType);
executable->finishCreation(vm);
UnlinkedEvalCodeBlock* unlinkedEvalCode = globalObject->createEvalCodeBlock(exec, executable, variablesUnderTDZ);
if (!unlinkedEvalCode)
return 0;
executable->m_unlinkedEvalCodeBlock.set(vm, executable, unlinkedEvalCode);
return executable;
}