mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-11-02 12:37:31 +09:00
Convert the trailing array of BindingNames at the end of the various kinds of scope data into raw unsigned chars into which those BindingNames are placement-new'd, rather than memcpy-ing non-trivial classes around and failing to comply with the C++ object model
This commit is contained in:
parent
36607675b2
commit
4cbf54089a
6 changed files with 108 additions and 64 deletions
|
|
@ -319,7 +319,7 @@ ScopeKindIsInBody(ScopeKind kind)
|
|||
static inline void
|
||||
MarkAllBindingsClosedOver(LexicalScope::Data& data)
|
||||
{
|
||||
BindingName* names = data.names;
|
||||
TrailingNamesArray& names = data.trailingNames;
|
||||
for (uint32_t i = 0; i < data.length; i++)
|
||||
names[i] = BindingName(names[i].name(), true);
|
||||
}
|
||||
|
|
@ -8978,7 +8978,8 @@ BytecodeEmitter::isRestParameter(ParseNode* pn, bool* result)
|
|||
if (bindings->nonPositionalFormalStart > 0) {
|
||||
// |paramName| can be nullptr when the rest destructuring syntax is
|
||||
// used: `function f(...[]) {}`.
|
||||
JSAtom* paramName = bindings->names[bindings->nonPositionalFormalStart - 1].name();
|
||||
JSAtom* paramName =
|
||||
bindings->trailingNames[bindings->nonPositionalFormalStart - 1].name();
|
||||
*result = paramName && name == paramName;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue