@@ -524,85 +524,6 @@ impl<'a, 'b: 'a, RT: Runtime, E: IsolateEnvironment<RT>> ExecutionScope<'a, 'b,
524524 Ok ( v8:: Local :: new ( & mut scope, handle) )
525525 }
526526
527- pub fn op (
528- & mut self ,
529- args : v8:: FunctionCallbackArguments ,
530- rv : v8:: ReturnValue ,
531- ) -> anyhow:: Result < ( ) > {
532- let _s = static_span ! ( ) ;
533- if args. length ( ) < 1 {
534- // This must be a bug in our `udf-runtime` code, not a developer error.
535- anyhow:: bail!( "op(op_name, ...) takes at least one argument" ) ;
536- }
537- let op_name: v8:: Local < v8:: String > = args. get ( 0 ) . try_into ( ) ?;
538- let op_name = to_rust_string ( self , & op_name) ?;
539-
540- let timer = metrics:: op_timer ( & op_name) ;
541-
542- match & op_name[ ..] {
543- "throwUncatchableDeveloperError" => self . op_throwUncatchableDeveloperError ( args, rv) ?,
544- "console/message" => self . op_console_message ( args, rv) ?,
545- "console/trace" => self . op_console_trace ( args, rv) ?,
546- "console/timeStart" => self . op_console_timeStart ( args, rv) ?,
547- "console/timeLog" => self . op_console_timeLog ( args, rv) ?,
548- "console/timeEnd" => self . op_console_timeEnd ( args, rv) ?,
549- "error/stack" => self . op_error_stack ( args, rv) ?,
550- "random" => self . op_random ( args, rv) ?,
551- "now" => self . op_now ( args, rv) ?,
552- "url/getUrlInfo" => self . op_url_getUrlInfo ( args, rv) ?,
553- "url/getUrlSearchParamPairs" => self . op_url_getUrlSearchParamPairs ( args, rv) ?,
554- "url/stringifyUrlSearchParams" => self . op_url_stringifyUrlSearchParams ( args, rv) ?,
555- "url/updateUrlInfo" => self . op_url_updateUrlInfo ( args, rv) ?,
556- "blob/createPart" => self . op_blob_createPart ( args, rv) ?,
557- "blob/slicePart" => self . op_blob_slicePart ( args, rv) ?,
558- "blob/readPart" => self . op_blob_readPart ( args, rv) ?,
559- "stream/create" => self . op_stream_create ( args, rv) ?,
560- "stream/extend" => self . op_stream_extend ( args, rv) ?,
561- "headers/getMimeType" => self . op_headers_getMimeType ( args, rv) ?,
562- "headers/normalizeName" => self . op_headers_normalizeName ( args, rv) ?,
563- "textEncoder/encode" => self . op_textEncoder_encode ( args, rv) ?,
564- "textEncoder/encodeInto" => self . op_textEncoder_encodeInto ( args, rv) ?,
565- "textEncoder/decode" => self . op_textEncoder_decode ( args, rv) ?,
566- "textEncoder/normalizeLabel" => self . op_textEncoder_normalizeLabel ( args, rv) ?,
567- "atob" => self . op_atob ( args, rv) ?,
568- "btoa" => self . op_btoa ( args, rv) ?,
569- "environmentVariables/get" => self . op_environmentVariables_get ( args, rv) ?,
570- "getTableMappingWithoutSystemTables" => {
571- self . op_getTableMappingWithoutSystemTables ( args, rv) ?
572- } ,
573- "validateArgs" => self . op_validate_args ( args, rv) ?,
574- "crypto/randomUUID" => self . op_crypto_randomUUID ( args, rv) ?,
575- "crypto/getRandomValues" => self . op_crypto_getRandomValues ( args, rv) ?,
576- "crypto/sign" => self . op_crypto_sign ( args, rv) ?,
577- "crypto/signEd25519" => self . op_crypto_sign_ed25519 ( args, rv) ?,
578- "crypto/verify" => self . op_crypto_verify ( args, rv) ?,
579- "crypto/verifyEd25519" => self . op_crypto_verify_ed25519 ( args, rv) ?,
580- "crypto/deriveBits" => self . op_crypto_deriveBits ( args, rv) ?,
581- "crypto/digest" => self . op_crypto_digest ( args, rv) ?,
582- "crypto/importKey" => self . op_crypto_importKey ( args, rv) ?,
583- "crypto/importSpkiEd25519" => self . op_crypto_import_spki_ed25519 ( args, rv) ?,
584- "crypto/importPkcs8Ed25519" => self . op_crypto_import_pkcs8_ed25519 ( args, rv) ?,
585- "crypto/importSpkiX25519" => self . op_crypto_import_spki_x25519 ( args, rv) ?,
586- "crypto/importPkcs8X25519" => self . op_crypto_import_pkcs8_x25519 ( args, rv) ?,
587- "crypto/base64UrlEncode" => self . op_crypto_base64_url_encode ( args, rv) ?,
588- "crypto/base64UrlDecode" => self . op_crypto_base64_url_decode ( args, rv) ?,
589- "crypto/exportKey" => self . op_crypto_export_key ( args, rv) ?,
590- "crypto/exportSpkiEd25519" => self . op_crypto_export_spki_ed25519 ( args, rv) ?,
591- "crypto/exportPkcs8Ed25519" => self . op_crypto_export_pkcs8_ed25519 ( args, rv) ?,
592- "crypto/JwkXEd25519" => self . op_crypto_jwk_x_ed25519 ( args, rv) ?,
593- "crypto/exportSpkiX25519" => self . op_crypto_export_spki_x25519 ( args, rv) ?,
594- "crypto/exportPkcs8X25519" => self . op_crypto_export_pkcs8_x25519 ( args, rv) ?,
595- _ => {
596- anyhow:: bail!( ErrorMetadata :: bad_request(
597- "UnknownOperation" ,
598- format!( "Unknown operation {op_name}" )
599- ) ) ;
600- } ,
601- } ;
602- timer. finish ( ) ;
603- Ok ( ( ) )
604- }
605-
606527 pub fn async_op (
607528 & mut self ,
608529 args : v8:: FunctionCallbackArguments ,
0 commit comments