Exemplo n.º 1
0
        public void OnBind(ScriptRuntime runtime, TypeRegister register)
        {
            runtime.AddStaticModule("static_test1", context => QuickJS.Native.JSApi.JS_NewInt32(context, 123));
            runtime.AddStaticModule("static_test2", context => QuickJS.Native.JSApi.JS_NewInt32(context, 456));

            FSWatcher.Bind(register);
            QuickJS.Extra.WebSocket.Bind(register);
            QuickJS.Extra.XMLHttpRequest.Bind(register);
            if (!runtime.isWorker)
            {
                var uri = new Uri(baseUrl);
                QuickJS.Extra.DOMCompatibleLayer.Bind(register, uri);
                QuickJS.Extra.NodeCompatibleLayer.Bind(register);
            }
        }
Exemplo n.º 2
0
 public void EndStaticModule(string moduleName)
 {
     _runtime.AddStaticModule(moduleName, _moduleReg);
 }