mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
implement declare var, Function Decl, Function Expression
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
7c47c6ed51
commit
a545adebf5
28 changed files with 549 additions and 90 deletions
|
|
@ -5,6 +5,9 @@
|
|||
#include "interpreter/ByteCodeInterpreter.h"
|
||||
#include "parser/ast/Node.h"
|
||||
#include "runtime/Context.h"
|
||||
#include "runtime/Environment.h"
|
||||
#include "runtime/EnvironmentRecord.h"
|
||||
|
||||
|
||||
namespace Escargot {
|
||||
|
||||
|
|
@ -18,7 +21,10 @@ Script::ScriptExecuteResult Script::execute(Context* ctx)
|
|||
ByteCodeGenerator g;
|
||||
g.generateByteCode(ctx, m_topCodeBlock, programNode);
|
||||
|
||||
ExecutionContext ec(ctx, ctx->globalEnvironment());
|
||||
ExecutionState stateForInit(ctx);
|
||||
LexicalEnvironment* globalEnvironment = new LexicalEnvironment(new GlobalEnvironmentRecord(stateForInit, m_topCodeBlock, ctx->globalObject()), nullptr);
|
||||
|
||||
ExecutionContext ec(ctx, globalEnvironment);
|
||||
Value resultValue;
|
||||
ExecutionState state(ctx, &ec, &resultValue);
|
||||
ByteCodeIntrepreter::interpret(state, m_topCodeBlock);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue