@@ -269,34 +269,14 @@ impl Isolate {
269
269
zero_copy_buf : deno_pinned_buf ,
270
270
) {
271
271
let isolate = unsafe { Isolate :: from_raw_ptr ( user_data) } ;
272
- let control_shared = isolate. shared . shift ( ) ;
273
272
274
- let op = if control_argv0. len ( ) > 0 {
275
- // The user called Deno.core.send(control)
276
- if let Some ( ref f) = isolate. dispatch {
277
- f ( control_argv0. as_ref ( ) , PinnedBuf :: new ( zero_copy_buf) )
278
- } else {
279
- panic ! ( "isolate.dispatch not set" )
280
- }
281
- } else if let Some ( c) = control_shared {
282
- // The user called Deno.sharedQueue.push(control)
283
- if let Some ( ref f) = isolate. dispatch {
284
- f ( & c, PinnedBuf :: new ( zero_copy_buf) )
285
- } else {
286
- panic ! ( "isolate.dispatch not set" )
287
- }
273
+ let op = if let Some ( ref f) = isolate. dispatch {
274
+ f ( control_argv0. as_ref ( ) , PinnedBuf :: new ( zero_copy_buf) )
288
275
} else {
289
- // The sharedQueue is empty. The shouldn't happen usually, but it's also
290
- // not technically a failure.
291
- #[ cfg( test) ]
292
- unreachable ! ( ) ;
293
- #[ cfg( not( test) ) ]
294
- return ;
276
+ panic ! ( "isolate.dispatch not set" )
295
277
} ;
296
278
297
- // At this point the SharedQueue should be empty.
298
- assert_eq ! ( isolate. shared. size( ) , 0 ) ;
299
-
279
+ debug_assert_eq ! ( isolate. shared. size( ) , 0 ) ;
300
280
match op {
301
281
Op :: Sync ( buf) => {
302
282
// For sync messages, we always return the response via Deno.core.send's
@@ -871,43 +851,6 @@ pub mod tests {
871
851
} ) ;
872
852
}
873
853
874
- #[ test]
875
- fn test_shared ( ) {
876
- run_in_task ( || {
877
- let ( mut isolate, dispatch_count) = setup ( Mode :: AsyncImmediate ) ;
878
-
879
- js_check ( isolate. execute (
880
- "setup2.js" ,
881
- r#"
882
- let nrecv = 0;
883
- Deno.core.setAsyncHandler((buf) => {
884
- assert(buf.byteLength === 1);
885
- assert(buf[0] === 43);
886
- nrecv++;
887
- });
888
- "# ,
889
- ) ) ;
890
- assert_eq ! ( dispatch_count. load( Ordering :: Relaxed ) , 0 ) ;
891
-
892
- js_check ( isolate. execute (
893
- "send1.js" ,
894
- r#"
895
- let control = new Uint8Array([42]);
896
- Deno.core.sharedQueue.push(control);
897
- Deno.core.send();
898
- assert(nrecv === 0);
899
-
900
- Deno.core.sharedQueue.push(control);
901
- Deno.core.send();
902
- assert(nrecv === 0);
903
- "# ,
904
- ) ) ;
905
- assert_eq ! ( dispatch_count. load( Ordering :: Relaxed ) , 2 ) ;
906
- assert_eq ! ( Async :: Ready ( ( ) ) , isolate. poll( ) . unwrap( ) ) ;
907
- js_check ( isolate. execute ( "send1.js" , "assert(nrecv === 2);" ) ) ;
908
- } ) ;
909
- }
910
-
911
854
#[ test]
912
855
fn dyn_import_err ( ) {
913
856
// Test an erroneous dynamic import where the specified module isn't found.
0 commit comments