mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
Issue #2155 - Fix wrong assertion
(x) = function() {..} is an extremely sparsely documented way to prevent function name inference.
Modeled after how BytecodeEmitter::emitInitializer does it.
This commit is contained in:
parent
76c2030142
commit
fbb5f73459
1 changed files with 3 additions and 3 deletions
|
|
@ -3784,7 +3784,7 @@ BytecodeEmitter::emitNameIncDec(ParseNode* incDec)
|
|||
|
||||
ParseNodeKind kind = incDec->getKind();
|
||||
NameNode* name = &incDec->pn_kid->as<NameNode>();
|
||||
NameOpEmitter noe(this, name->atom(),
|
||||
NameOpEmitter noe(this, name->pn_atom,
|
||||
kind == PNK_POSTINCREMENT ? NameOpEmitter::Kind::PostIncrement
|
||||
: kind == PNK_PREINCREMENT ? NameOpEmitter::Kind::PreIncrement
|
||||
: kind == PNK_POSTDECREMENT ? NameOpEmitter::Kind::PostDecrement
|
||||
|
|
@ -5838,8 +5838,8 @@ BytecodeEmitter::emitAssignment(ParseNode* lhs, JSOp compoundOp, ParseNode* rhs)
|
|||
if (!EmitAssignmentRhs(this, rhs, offset)) { // ENV? VAL? RHS
|
||||
return false;
|
||||
}
|
||||
if (rhs && rhs->isDirectRHSAnonFunction()) {
|
||||
MOZ_ASSERT(!lhs->isInParens());
|
||||
// Assign inferred function name, unless the lhs is parenthesized
|
||||
if (rhs && rhs->isDirectRHSAnonFunction() && !lhs->isInParens()) {
|
||||
MOZ_ASSERT(!isCompound);
|
||||
RootedAtom name(cx, lhs->name());
|
||||
if (!setOrEmitSetFunName(rhs, name)) { // ENV? VAL? RHS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue