mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Fix wrong register calculation in AssignmentExpressionSimpleNode
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
babcedce95
commit
2bde2b91e3
3 changed files with 5 additions and 13 deletions
|
|
@ -82,6 +82,7 @@ protected:
|
|||
for (size_t i = 0; i < leftNames.size(); i++) {
|
||||
if (leftNames[i] == name) {
|
||||
isSlowMode = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -95,15 +96,7 @@ protected:
|
|||
AtomicString leftName = m_left->asIdentifier()->name();
|
||||
bool result = false;
|
||||
m_right->iterateChildren([&](Node* node) {
|
||||
if (node->type() == ASTNodeType::UnaryExpressionDelete) {
|
||||
UnaryExpressionDeleteNode* del = ((UnaryExpressionDeleteNode*)node);
|
||||
if (del->argument()->isIdentifier()) {
|
||||
if (leftName == del->argument()->asIdentifier()->name()) {
|
||||
// x = delete x;
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
} else if (node->type() == ASTNodeType::CallExpression) {
|
||||
if (node->type() == ASTNodeType::CallExpression) {
|
||||
CallExpressionNode* call = (CallExpressionNode*)node;
|
||||
if (call->callee()->isIdentifier() && call->callee()->asIdentifier()->name().string()->equals("eval")) {
|
||||
// x = (eval("var x;"), 1);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ public:
|
|||
isSlowMode = isSlowMode || isLeftBindingAffectedByRightExpression();
|
||||
}
|
||||
|
||||
bool isBase = context->m_registerStack->size() == 0;
|
||||
size_t rightRegister = dstRegister;
|
||||
|
||||
if (isSlowMode) {
|
||||
|
|
|
|||
|
|
@ -326,10 +326,10 @@ private:
|
|||
if (context->m_isWithScope) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (context->m_isLeftBindingAffectedByRightExpression) {
|
||||
return true;
|
||||
if (context->m_isLeftBindingAffectedByRightExpression) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue