feat: for-of 异常中断按规范关闭迭代器,next() 抛错可捕获并保留原始值

This commit is contained in:
爱特每羊队
2026-06-27 18:28:07 +08:00
parent 09a9d3dfd2
commit 11d69ea95c
8 changed files with 263 additions and 9 deletions
+3
View File
@@ -101,6 +101,9 @@ pub trait VmHost {
// Call infrastructure
fn call_function_sync(&mut self, callee: JsValue, receiver: JsValue, args: &[JsValue]) -> Result<JsValue, String>;
/// Take the original thrown JsValue preserved across a String-flattening call boundary,
/// so an iterator wrapper can re-throw the original error instead of re-wrapping it.
fn take_uncaught_value(&mut self) -> Option<JsValue>;
// Error handling
fn checked_object_ptr(&mut self, val: JsValue, error_msg: &str) -> Result<Option<*mut JsObject>, String>;