mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Implement chain of ClassPrivateMemberData
* Each chain piece represents one of class * User can uses private member with same name parent with child class * We should check nearest [[homeObject]] of function to find where function is located Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
9c437bd8d7
commit
8c3cd2f3b1
19 changed files with 320 additions and 294 deletions
|
|
@ -91,6 +91,23 @@ InterpretedCodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context*
|
|||
} else if (c->isClassConstructor()) {
|
||||
c->m_canAllocateEnvironmentOnStack = false;
|
||||
break;
|
||||
} else if ((c->isClassMethod() || c->isClassStaticMethod()) && scopeCtx->m_hasClassPrivateNameExpression) {
|
||||
/*
|
||||
// this covers case below
|
||||
var C = class {
|
||||
#f = 'Test262';
|
||||
|
||||
method() {
|
||||
let arrowFunction = () => {
|
||||
return this.#f; // private member access needs upper env's homeObject
|
||||
}
|
||||
|
||||
return arrowFunction();
|
||||
}
|
||||
}
|
||||
*/
|
||||
c->m_canAllocateEnvironmentOnStack = false;
|
||||
break;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue