mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1203733 - Fix emitting super.prop1.prop2. (r=jorendorff)
This commit is contained in:
parent
d9f4dfbbb5
commit
e5087d26a8
@ -2551,17 +2551,16 @@ bool
|
||||
BytecodeEmitter::emitPropLHS(ParseNode* pn)
|
||||
{
|
||||
MOZ_ASSERT(pn->isKind(PNK_DOT));
|
||||
ParseNode* pn2 = pn->maybeExpr();
|
||||
MOZ_ASSERT(!pn->as<PropertyAccess>().isSuper());
|
||||
|
||||
// Don't want super sneaking in here.
|
||||
MOZ_ASSERT(!pn2->isKind(PNK_POSHOLDER));
|
||||
ParseNode* pn2 = pn->maybeExpr();
|
||||
|
||||
/*
|
||||
* If the object operand is also a dotted property reference, reverse the
|
||||
* list linked via pn_expr temporarily so we can iterate over it from the
|
||||
* bottom up (reversing again as we go), to avoid excessive recursion.
|
||||
*/
|
||||
if (pn2->isKind(PNK_DOT)) {
|
||||
if (pn2->isKind(PNK_DOT) && !pn2->as<PropertyAccess>().isSuper()) {
|
||||
ParseNode* pndot = pn2;
|
||||
ParseNode* pnup = nullptr;
|
||||
ParseNode* pndown;
|
||||
|
18
js/src/tests/ecma_6/Class/superPropBasicChain.js
Normal file
18
js/src/tests/ecma_6/Class/superPropBasicChain.js
Normal file
@ -0,0 +1,18 @@
|
||||
var test = `
|
||||
|
||||
var o = {
|
||||
access() {
|
||||
super.foo.bar;
|
||||
}
|
||||
};
|
||||
|
||||
// Delazify
|
||||
assertThrowsInstanceOf(o.access, TypeError);
|
||||
|
||||
`;
|
||||
|
||||
if (classesEnabled())
|
||||
eval(test);
|
||||
|
||||
if (typeof reportCompare === 'function')
|
||||
reportCompare(0,0,"OK");
|
Loading…
Reference in New Issue
Block a user