summaryrefslogtreecommitdiff
path: root/ops/fast_call.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ops/fast_call.rs')
-rw-r--r--ops/fast_call.rs35
1 files changed, 5 insertions, 30 deletions
diff --git a/ops/fast_call.rs b/ops/fast_call.rs
index 2485b6083..ebbb1927b 100644
--- a/ops/fast_call.rs
+++ b/ops/fast_call.rs
@@ -245,41 +245,16 @@ pub(crate) fn generate(
}
if optimizer.is_async {
- // Referenced variables are declared in parent block.
- let track_async = q!({
- let __op_id = __ctx.id;
- let __state = ::std::cell::RefCell::borrow(&__ctx.state);
- __state.tracker.track_async(__op_id);
- });
-
- output_transforms.push_tokens(&track_async);
-
let queue_future = if optimizer.returns_result {
q!({
- let realm_idx = __ctx.realm_idx;
- let __get_class = __state.get_error_class_fn;
- let result = _ops::queue_fast_async_op(__ctx, async move {
- let result = result.await;
- (
- realm_idx,
- __promise_id,
- __op_id,
- _ops::to_op_result(__get_class, result),
- )
- });
+ let result = _ops::queue_fast_async_op(__ctx, __promise_id, result);
})
} else {
q!({
- let realm_idx = __ctx.realm_idx;
- let result = _ops::queue_fast_async_op(__ctx, async move {
- let result = result.await;
- (
- realm_idx,
- __promise_id,
- __op_id,
- _ops::OpResult::Ok(result.into()),
- )
- });
+ let result =
+ _ops::queue_fast_async_op(__ctx, __promise_id, async move {
+ Ok(result.await)
+ });
})
};