Skip to content

panic: iterator [[Done]] was not a boolean #2658

Closed
@langston-barrett

Description

function AddPromise(){}tests=[{body(){}},{body(){}},{body(){async function*agf(a){for await(m of a){yield}}makeIter=function(){return{next(){return{e:this}}}}
iterTwo={[Symbol.asyncIterator]:makeIter}
const genTwo=agf(iterTwo);AddPromise(this.e,genTwo.next())
AddPromise(this.e,genTwo.next())}}]
for(const test of tests){test.body()}
undefined
thread 'main' panicked at 'iterator [[Done]] was not a boolean', boa_engine/src/vm/opcode/iteration/for_await.rs:24:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:64:14
   2: core::panicking::panic_display
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:147:5
   3: core::panicking::panic_str
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:131:5
   4: core::option::expect_failed
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/option.rs:1924:5
   5: <boa_engine::vm::opcode::iteration::for_await::ForAwaitOfLoopIterate as boa_engine::vm::opcode::Operation>::execute
   6: boa_engine::vm::<impl boa_engine::context::Context>::execute_instruction
   7: boa_engine::vm::<impl boa_engine::context::Context>::run
   8: <boa_engine::native_function::Closure<F,T> as boa_engine::native_function::TraceableClosure>::call
   9: boa_engine::vm::code_block::<impl boa_engine::object::jsobject::JsObject>::call_internal
  10: boa_engine::object::internal_methods::function::function_call{{reify.shim}}
  11: boa_engine::context::hooks::HostHooks::call_job_callback
  12: core::ops::function::FnOnce::call_once{{vtable.shim}}
  13: <boa::Jobs as boa_engine::job::JobQueue>::run_jobs
  14: boa::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Assignees

Labels

bugSomething isn't workingexecutionIssues or PRs related to code execution

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions