@@ -23,7 +23,6 @@ import * as net from "ext:deno_net/01_net.js";
2323import * as response from "ext:deno_fetch/23_response.js" ;
2424import * as request from "ext:deno_fetch/23_request.js" ;
2525import * as globalInterfaces from "ext:deno_web/04_global_interfaces.js" ;
26- import { SUPABASE_USER_WORKERS } from "ext:sb_user_workers/user_workers.js" ;
2726import { SUPABASE_ENV } from "ext:sb_env/env.js" ;
2827
2928
@@ -390,6 +389,28 @@ class NotSupported extends Error {
390389 }
391390}
392391
392+ const errors = {
393+ NotFound,
394+ PermissionDenied,
395+ ConnectionRefused,
396+ ConnectionReset,
397+ ConnectionAborted,
398+ NotConnected,
399+ AddrInUse,
400+ AddrNotAvailable,
401+ BrokenPipe,
402+ AlreadyExists,
403+ InvalidData,
404+ TimedOut,
405+ Interrupted : core . Interrupted ,
406+ WriteZero,
407+ UnexpectedEof,
408+ BadResource : core . BadResource ,
409+ Http,
410+ Busy,
411+ NotSupported,
412+ }
413+
393414function registerErrors ( ) {
394415 core . registerErrorClass ( "NotFound" , NotFound ) ;
395416 core . registerErrorClass ( "PermissionDenied" , PermissionDenied ) ;
@@ -526,12 +547,6 @@ Deno.startTls = tls.startTls;
526547Deno . resolveDns = net . resolveDns ;
527548Deno . serveHttp = serveHttp ;
528549
529- // EdgeRuntime namespace
530- // FIXME: Make the object read-only
531- globalThis . EdgeRuntime = {
532- userWorkers : SUPABASE_USER_WORKERS
533- } ;
534-
535550const __bootstrap = globalThis . __bootstrap ;
536551delete globalThis . __bootstrap ;
537552delete globalThis . bootstrap ;
@@ -575,7 +590,9 @@ ObjectDefineProperties(Deno, {
575590 env : readOnly ( SUPABASE_ENV ) ,
576591 pid : readOnly ( globalThis . __pid ) ,
577592 args : readOnly ( [ ] ) , // args are set to be empty
578- mainModule : getterOnly ( opMainModule )
593+ mainModule : getterOnly ( opMainModule ) ,
594+ errors,
595+
579596} ) ;
580597
581598// TODO: Abstract this file into multiple files. There's too much boilerplate
0 commit comments