pub fn for_of<Callback, OtherError>(
cx: *mut JSContext,
iterable: HandleValue<'_>,
callback: Callback,
) -> Result<(), ForOfIterationFailure<OtherError>>where
Callback: FnMut(HandleValue<'_>) -> Result<ControlFlow<()>, ForOfIterationFailure<OtherError>>,Expand description
Helper for running for .. of iteration from rust.
If Ok() is returned then the iteration completed without unexpected failures.
The callback returns Err() to indicate a pending exception or Ok() containing a boolean
value that is true if the iterator should continue iterating.