mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Implement runtime part of dynamic-import
* Implement one of parsing error of module * Fix one of stack usage error on FunctionObjectInlines Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
5dc636380c
commit
ba4763e888
12 changed files with 181 additions and 347 deletions
|
|
@ -37,9 +37,22 @@ namespace Escargot {
|
|||
|
||||
bool Script::isExecuted()
|
||||
{
|
||||
if (isModule()) {
|
||||
return m_moduleData->m_status != ModuleData::ModuleStatus::Uninstantiated;
|
||||
}
|
||||
return m_topCodeBlock->byteCodeBlock() == nullptr;
|
||||
}
|
||||
|
||||
bool Script::wasThereErrorOnModuleEvaluation()
|
||||
{
|
||||
return m_moduleData && m_moduleData->m_hasEvaluationError;
|
||||
}
|
||||
|
||||
Value Script::moduleEvaluationError()
|
||||
{
|
||||
return m_moduleData ? Value(m_moduleData->m_evaluationError) : Value();
|
||||
}
|
||||
|
||||
Context* Script::context()
|
||||
{
|
||||
return m_topCodeBlock->context();
|
||||
|
|
@ -687,6 +700,7 @@ Script::ModuleExecutionResult Script::moduleEvaluate(ExecutionState& state)
|
|||
// Assert: module.[[Status]] is "evaluated" and module.[[EvaluationError]] is result.
|
||||
stack[i]->moduleData()->m_status = ModuleData::Evaluated;
|
||||
stack[i]->moduleData()->m_evaluationError = result.value;
|
||||
stack[i]->moduleData()->m_hasEvaluationError = true;
|
||||
}
|
||||
// Return result.
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue