From 61d45f8e4d28076b616f76246f2ac18783cafe13 Mon Sep 17 00:00:00 2001 From: Haled Odat <8566042+HalidOdat@users.noreply.github.com> Date: Wed, 27 Sep 2023 21:18:45 +0200 Subject: [PATCH] Allow optimizing with destructuring --- boa_engine/src/bytecompiler/declarations.rs | 33 ++++++++++++------- boa_engine/src/bytecompiler/statement/loop.rs | 9 ++++- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/boa_engine/src/bytecompiler/declarations.rs b/boa_engine/src/bytecompiler/declarations.rs index 450e1d31712..95a43da0d92 100644 --- a/boa_engine/src/bytecompiler/declarations.rs +++ b/boa_engine/src/bytecompiler/declarations.rs @@ -5,7 +5,7 @@ use crate::{ create_function_object_fast, create_generator_function_object, BindingOpcode, CodeBlockFlags, Opcode, }, - JsNativeError, JsResult, + JsNativeError, JsResult, JsString, }; use boa_ast::{ declaration::{Binding, LexicalDeclaration, VariableList}, @@ -848,6 +848,16 @@ impl ByteCompiler<'_, '_> { strict: bool, generator: bool, ) -> (Option