mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
1. add initial version internal test
2. revise .gitlab-ci.yml 3. fix variable binding bug in with block 4. fix toLowerCase, toUpperCase bug Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
521dd64de2
commit
ac77c0ad26
13 changed files with 221 additions and 61 deletions
|
|
@ -138,9 +138,15 @@ Value Script::executeLocal(ExecutionState& state, Value thisValue, CodeBlock* pa
|
|||
|
||||
const CodeBlock::IdentifierInfoVector& vec = m_topCodeBlock->identifierInfos();
|
||||
size_t len = vec.size();
|
||||
EnvironmentRecord* recordToAddVariable = record;
|
||||
LexicalEnvironment* e = state.executionContext()->lexicalEnvironment();
|
||||
while (recordToAddVariable->isObjectEnvironmentRecord()) {
|
||||
e = e->outerEnvironment();
|
||||
recordToAddVariable = e->record();
|
||||
}
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
if (record->hasBinding(state, vec[i].m_name).m_index == SIZE_MAX) {
|
||||
record->createMutableBinding(state, vec[i].m_name, true);
|
||||
if (recordToAddVariable->hasBinding(state, vec[i].m_name).m_index == SIZE_MAX) {
|
||||
recordToAddVariable->createMutableBinding(state, vec[i].m_name, true);
|
||||
}
|
||||
}
|
||||
LexicalEnvironment* newEnvironment = new LexicalEnvironment(record, state.executionContext()->lexicalEnvironment());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue