diff --git a/boa/src/builtins/iterable/mod.rs b/boa/src/builtins/iterable/mod.rs index 0c3c5a63c81..0624665e74d 100644 --- a/boa/src/builtins/iterable/mod.rs +++ b/boa/src/builtins/iterable/mod.rs @@ -195,6 +195,16 @@ impl IteratorRecord { } } + #[cfg(feature = "vm")] + pub(crate) fn iterator_object(&self) -> &JsValue { + &self.iterator_object + } + + #[cfg(feature = "vm")] + pub(crate) fn next_function(&self) -> &JsValue { + &self.next_function + } + /// Get the next value in the iterator /// /// More information: diff --git a/boa/src/bytecompiler.rs b/boa/src/bytecompiler.rs index 0d87d2471e4..fe5d83eb2e8 100644 --- a/boa/src/bytecompiler.rs +++ b/boa/src/bytecompiler.rs @@ -4,6 +4,9 @@ use crate::{ builtins::function::ThisMode, syntax::ast::{ node::{ + declaration::{BindingPatternTypeArray, BindingPatternTypeObject, DeclarationPattern}, + iteration::IterableLoopInitializer, + template::TemplateElement, Declaration, GetConstField, GetField, MethodDefinitionKind, PropertyDefinition, PropertyName, StatementList, }, @@ -31,10 +34,17 @@ struct Label { struct JumpControlInfo { label: Option>, start_address: u32, - is_loop: bool, + kind: JumpControlInfoKind, breaks: Vec