1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

LibJS/Bytecode: Throw on destructuring object assignment to nullish LHS

24 new passes on test262. :^)
This commit is contained in:
Andreas Kling 2023-06-25 08:50:07 +02:00
parent 4032bfc2fc
commit 8021048bc9
4 changed files with 30 additions and 0 deletions

View file

@ -989,6 +989,8 @@ Bytecode::CodeGenerationErrorOr<void> FunctionExpression::generate_bytecode(Byte
static Bytecode::CodeGenerationErrorOr<void> generate_object_binding_pattern_bytecode(Bytecode::Generator& generator, BindingPattern const& pattern, Bytecode::Op::SetVariable::InitializationMode initialization_mode, Bytecode::Register const& value_reg, bool create_variables)
{
generator.emit<Bytecode::Op::ThrowIfNullish>();
Vector<Bytecode::Register> excluded_property_names;
auto has_rest = false;
if (pattern.entries.size() > 0)