mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Implement JSON module parsing
Currently only the import statement is supported Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
parent
b992df9a06
commit
3a0b874a7e
12 changed files with 199 additions and 85 deletions
|
|
@ -541,6 +541,26 @@ void ScriptParser::generateFunctionByteCode(ExecutionState& state, InterpretedCo
|
|||
GC_enable();
|
||||
}
|
||||
|
||||
Script* ScriptParser::initializeJSONModule(String* source, String* srcName)
|
||||
{
|
||||
Script::ModuleData* moduleData = new Script::ModuleData();
|
||||
|
||||
Script::ExportEntry entry;
|
||||
entry.m_exportName = m_context->staticStrings().stringDefault;
|
||||
entry.m_localName = m_context->staticStrings().stringStarDefaultStar;
|
||||
|
||||
moduleData->m_localExportEntries.push_back(entry);
|
||||
|
||||
Script* script = new Script(srcName, source, moduleData, false, 0);
|
||||
|
||||
ModuleEnvironmentRecord* moduleRecord = new ModuleEnvironmentRecord(script);
|
||||
moduleData->m_moduleRecord = moduleRecord;
|
||||
|
||||
moduleData->m_cycleRoot = script;
|
||||
moduleData->m_status = Script::ModuleData::Linked;
|
||||
return script;
|
||||
}
|
||||
|
||||
#ifdef ESCARGOT_DEBUGGER
|
||||
|
||||
void ScriptParser::recursivelyGenerateChildrenByteCode(InterpretedCodeBlock* parent)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue