@@ -22,6 +22,7 @@ mod streams;
2222mod timeout;
2323mod url;
2424mod util;
25+ mod web_crypto;
2526
2627pub fn add_module_resolvers (
2728 resolver : rquickjs:: loader:: BuiltinResolver ,
@@ -52,6 +53,8 @@ pub fn add_module_resolvers(
5253 . with_module ( "process" )
5354 . with_module ( "__wasm_rquickjs_builtin/url_native" )
5455 . with_module ( "__wasm_rquickjs_builtin/url" )
56+ . with_module ( "__wasm_rquickjs_builtin/web_crypto_native" )
57+ . with_module ( "__wasm_rquickjs_builtin/web_crypto" )
5558}
5659
5760pub fn module_loader ( ) -> (
@@ -81,7 +84,11 @@ pub fn module_loader() -> (
8184 "__wasm_rquickjs_builtin/process_native" ,
8285 process:: js_native_module,
8386 )
84- . with_module ( "__wasm_rquickjs_builtin/url_native" , url:: js_native_module) ,
87+ . with_module ( "__wasm_rquickjs_builtin/url_native" , url:: js_native_module)
88+ . with_module (
89+ "__wasm_rquickjs_builtin/web_crypto_native" ,
90+ web_crypto:: js_native_module,
91+ ) ,
8592 rquickjs:: loader:: BuiltinLoader :: default ( )
8693 . with_module ( "__wasm_rquickjs_builtin/console" , console:: CONSOLE_JS )
8794 . with_module ( "__wasm_rquickjs_builtin/timeout" , timeout:: TIMEOUT_JS )
@@ -100,7 +107,11 @@ pub fn module_loader() -> (
100107 . with_module ( "fs" , fs:: FS_JS )
101108 . with_module ( "node:process" , process:: PROCESS_JS )
102109 . with_module ( "process" , process:: PROCESS_JS )
103- . with_module ( "__wasm_rquickjs_builtin/url" , url:: URL_JS ) ,
110+ . with_module ( "__wasm_rquickjs_builtin/url" , url:: URL_JS )
111+ . with_module (
112+ "__wasm_rquickjs_builtin/web_crypto" ,
113+ web_crypto:: WEB_CRYPTO_JS ,
114+ ) ,
104115 )
105116}
106117
@@ -112,6 +123,7 @@ pub fn wire_builtins() -> String {
112123 writeln ! ( result, "{}" , streams:: WIRE_JS ) . unwrap ( ) ;
113124 writeln ! ( result, "{}" , encoding:: WIRE_JS ) . unwrap ( ) ;
114125 writeln ! ( result, "{}" , url:: WIRE_JS ) . unwrap ( ) ;
126+ writeln ! ( result, "{}" , web_crypto:: WIRE_JS ) . unwrap ( ) ;
115127
116128 result
117129}
0 commit comments