mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Fix errors (#467)
* Fix BDWGC compile option * Fix build error on ndk * Global declared function declaration should always create binding Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
ba4631ae02
commit
355c7eff53
11 changed files with 41 additions and 25 deletions
|
|
@ -486,6 +486,17 @@ Value Script::execute(ExecutionState& state, bool isExecuteOnEvalFunction, bool
|
|||
}
|
||||
|
||||
if (!isExecuteOnEvalFunction) {
|
||||
InterpretedCodeBlock* child = m_topCodeBlock->firstChild();
|
||||
while (child) {
|
||||
if (child->isFunctionDeclaration()) {
|
||||
if (!state.context()->globalObject()->defineOwnProperty(state, child->functionName(),
|
||||
ObjectPropertyDescriptor(Value(), (ObjectPropertyDescriptor::PresentAttribute)(ObjectPropertyDescriptor::WritablePresent | ObjectStructurePropertyDescriptor::EnumerablePresent)))) {
|
||||
ErrorObject::throwBuiltinError(state, ErrorObject::Code::SyntaxError, "Identifier '%s' has already been declared", child->functionName());
|
||||
}
|
||||
}
|
||||
child = child->nextSibling();
|
||||
}
|
||||
|
||||
const auto& globalLexicalVector = m_topCodeBlock->blockInfo(0)->m_identifiers;
|
||||
size_t len = globalLexicalVector.size();
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue