Update(boards): xpython板卡执行 build:prod
This commit is contained in:
7
boards/default/python_pyodide/69.bundle.js
Normal file
7
boards/default/python_pyodide/69.bundle.js
Normal file
@@ -0,0 +1,7 @@
|
||||
(()=>{"use strict";
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2019 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
const e=Symbol("Comlink.proxy"),t=Symbol("Comlink.endpoint"),n=Symbol("Comlink.releaseProxy"),r=Symbol("Comlink.finalizer"),a=Symbol("Comlink.thrown"),s=e=>"object"==typeof e&&null!==e||"function"==typeof e,o=new Map([["proxy",{canHandle:t=>s(t)&&t[e],serialize(e){const{port1:t,port2:n}=new MessageChannel;return i(e,t),[n,[n]]},deserialize(e){return e.start(),g(e,[],t);var t}}],["throw",{canHandle:e=>s(e)&&a in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function i(t,n=globalThis,s=["*"]){n.addEventListener("message",(function o(u){if(!u||!u.data)return;if(!function(e,t){for(const n of e){if(t===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(t))return!0}return!1}(s,u.origin))return void console.warn(`Invalid origin '${u.origin}' for comlink proxy`);const{id:l,type:f,path:p}=Object.assign({path:[]},u.data),g=(u.data.argumentList||[]).map(E);let h;try{const n=p.slice(0,-1).reduce(((e,t)=>e[t]),t),r=p.reduce(((e,t)=>e[t]),t);switch(f){case"GET":h=r;break;case"SET":n[p.slice(-1)[0]]=E(u.data.value),h=!0;break;case"APPLY":h=r.apply(n,g);break;case"CONSTRUCT":h=function(t){return Object.assign(t,{[e]:!0})}(new r(...g));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;i(t,n),h=m(e,[e])}break;case"RELEASE":h=void 0;break;default:return}}catch(e){h={value:e,[a]:0}}Promise.resolve(h).catch((e=>({value:e,[a]:0}))).then((e=>{const[a,s]=y(e);n.postMessage(Object.assign(Object.assign({},a),{id:l}),s),"RELEASE"===f&&(n.removeEventListener("message",o),c(n),r in t&&"function"==typeof t[r]&&t[r]())})).catch((e=>{const[t,r]=y({value:new TypeError("Unserializable return value"),[a]:0});n.postMessage(Object.assign(Object.assign({},t),{id:l}),r)}))})),n.start&&n.start()}function c(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function u(e){if(e)throw new Error("Proxy has been released and is not useable")}function l(e){return b(e,{type:"RELEASE"}).then((()=>{c(e)}))}const f=new WeakMap,p="FinalizationRegistry"in globalThis&&new FinalizationRegistry((e=>{const t=(f.get(e)||0)-1;f.set(e,t),0===t&&l(e)}));function g(e,r=[],a=function(){}){let s=!1;const o=new Proxy(a,{get(t,a){if(u(s),a===n)return()=>{!function(e){p&&p.unregister(e)}(o),l(e),s=!0};if("then"===a){if(0===r.length)return{then:()=>o};const t=b(e,{type:"GET",path:r.map((e=>e.toString()))}).then(E);return t.then.bind(t)}return g(e,[...r,a])},set(t,n,a){u(s);const[o,i]=y(a);return b(e,{type:"SET",path:[...r,n].map((e=>e.toString())),value:o},i).then(E)},apply(n,a,o){u(s);const i=r[r.length-1];if(i===t)return b(e,{type:"ENDPOINT"}).then(E);if("bind"===i)return g(e,r.slice(0,-1));const[c,l]=h(o);return b(e,{type:"APPLY",path:r.map((e=>e.toString())),argumentList:c},l).then(E)},construct(t,n){u(s);const[a,o]=h(n);return b(e,{type:"CONSTRUCT",path:r.map((e=>e.toString())),argumentList:a},o).then(E)}});return function(e,t){const n=(f.get(t)||0)+1;f.set(t,n),p&&p.register(e,t,e)}(o,e),o}function h(e){const t=e.map(y);return[t.map((e=>e[0])),(n=t.map((e=>e[1])),Array.prototype.concat.apply([],n))];var n}const d=new WeakMap;function m(e,t){return d.set(e,t),e}function y(e){for(const[t,n]of o)if(n.canHandle(e)){const[r,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},a]}return[{type:"RAW",value:e},d.get(e)||[]]}function E(e){switch(e.type){case"HANDLER":return o.get(e.name).deserialize(e.value);case"RAW":return e.value}}function b(e,t,n){return new Promise((r=>{const a=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){n.data&&n.data.id&&n.data.id===a&&(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),n)}))}i(new class{async fetch(e,t){const n=e=>e.substring(0,e.lastIndexOf("/")),r=n(new URL(globalThis.location.toString()).href);if(!n(new URL(e).href).startsWith(r))throw new Error(`URL ${e} is outside of proxy' scope`);if("omit"!==t?.credentials)throw new Error("Request tries to use credentials");const a=await globalThis.fetch(e,t),s=await a.arrayBuffer();return{body:m(s,[s]),options:{status:a.status,statusText:a.statusText,headers:new Map(a.headers)}}}})})();
|
||||
Reference in New Issue
Block a user