mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Implement the lexical scoping (#285)
This patch introduces the let and const keyword and all the related lexical scoping rules. Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
parent
8581b547b5
commit
ef59096112
32 changed files with 1026 additions and 94 deletions
|
|
@ -107,7 +107,9 @@ Value Script::executeLocal(ExecutionState& state, Value thisValue, InterpretedCo
|
|||
recordToAddVariable = e->record();
|
||||
}
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
recordToAddVariable->createBinding(state, vec[i].m_name, inStrict ? false : true, true);
|
||||
if (vec[i].m_isVarDeclaration) {
|
||||
recordToAddVariable->createBinding(state, vec[i].m_name, inStrict ? false : true, true);
|
||||
}
|
||||
}
|
||||
LexicalEnvironment* newEnvironment = new LexicalEnvironment(record, state.lexicalEnvironment());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue