@devvit/runtime-lite 0.11.0-next-2024-07-12-0f1c33b16.0 → 0.11.0-next-2024-07-15-adba61cda.0
Sign up to get free protection for your applications and to get access to all the features.
package/browser-lite.worker.js
CHANGED
@@ -160024,5 +160024,5 @@ export {
|
|
160024
160024
|
};`,"globalThis.devvit = { config: { assets: config.assets } };");try{xr(this,bm,r.unwrapResult(r.evalCode(`
|
160025
160025
|
if (!module.exports?.default) throw Error('bundle missing default export')
|
160026
160026
|
new module.exports.default(config);
|
160027
|
-
`)))}catch(o){throw gi(this,ql,Im).call(this,o),o}}async callBinary(t,r,o){return await LT(Ae(this,Gm)[t],this.call,t,r,o)}async call(t,r,o,a){return a?await this.callBinary(t,r,o):uo.withScopeAsync(async i=>{let m=i.manage(Ae(this,Ll).newContext()),A=Ae(this,bm);if(xr(this,Ml,!1),Ae(this,Mi).logs=[],!A)return{error:new Error("No actor loaded"),success:!1,value:void 0};let p=m.getProp(A,t),u=Ae(this,Jm).call(this,m,r),g={...Ae(this,Om),...o,...Ae(this,Um)},S=Ae(this,Jm).call(this,m,g),te=m.callFunction(p,A,u,S),ue;try{ue=m.unwrapResult(te)}catch(ot){return gi(this,ql,Im).call(this,ot),{error:ot,success:!1,value:void 0}}let De;try{[De]=await Promise.all([m.resolvePromise(ue),m.runtime.executePendingJobs()])}catch(ot){return gi(this,ql,Im).call(this,ot),{error:ot,success:!1,value:void 0}}let mt;try{mt=m.unwrapResult(De)}catch(ot){return gi(this,ql,Im).call(this,ot),{error:ot,success:!1,value:void 0}}let Rl=m.dump(mt);return Ae(this,Ml)?(Ae(this,Mi).logs=[],{error:h3(t),success:!1,value:void 0}):{error:void 0,success:!0,value:Rl}})}onPluginResponse(t,r){let o=Ae(this,vm)[t];if(o&&o.alive)if(r.success){let a=Ae(this,Ft).newString(JSON.stringify(r.value));o.resolve(a),Ae(this,Ft).runtime.executePendingJobs(),a.dispose()}else{let a=Ae(this,Ft).newError(r.error.message);o.reject(a),Ae(this,Ft).runtime.executePendingJobs(),a.dispose()}o.dispose(),delete Ae(this,vm)[t]}quit(){var t;Tl.log("[sandboxed runtime] quitting"),(t=Ae(this,bm))==null||t.dispose(),Ae(this,fm).dispose(),Ae(this,Ft).dispose(),Ae(this,Ll).dispose(),globalThis.close()}};Ll=new WeakMap,Ft=new WeakMap,fm=new WeakMap,bm=new WeakMap,Ml=new WeakMap,Mi=new WeakMap,Fl=new WeakMap,uv=new WeakMap,vm=new WeakMap,Om=new WeakMap,Um=new WeakMap,Gm=new WeakMap,Jm=new WeakMap,Vm=new WeakSet,mv=function(e,...t){for(let r of t)e.unwrapResult(e.evalCode(r,void 0,{type:"global"})).dispose()},nA=new WeakSet,bl=function(...e){let t=Ae(this,Ft);for(let r of e)t.unwrapResult(t.evalCode(r)).dispose()},pv=new WeakMap,fv=new WeakMap,bv=new WeakMap,vv=new WeakMap,Iv=new WeakMap,Cv=new WeakMap,ql=new WeakSet,Im=function(e){var t;Mz(e)||((t=Ae(this,Mi)).logs??(t.logs=[]),Ae(this,Mi).logs.push({method:"error",args:[dA(e)]}))};function FT(e){return e.hostname.split(".")[1]??e.hostname}function qT(e){var t,r;return`${FT(e)}@${(t=e.actor)==null?void 0:t.version} by ${(r=e.actor)==null?void 0:r.owner}`}function PT(e,t){Object.assign(e,{CircuitBreakerResponse:Up,log:OT,onmessage:UT,onunhandledrejection:GT,runtime:t})}function xT(e){e.postMessage([Oa.READY])}function OT(...e){this.debugLogging&&console.debug.apply(null,e)}async function UT(e){switch(e.data[0]){case sA.ENABLE_APP_LOGGING:this.runtime.enableAppLogging(),this.log("<App logs enabled>");break;case sA.ENABLE_DEBUG_LOGGING:this.debugLogging=!0,this.log("<Debug logs enabled>");break;case sA.ENABLE_PLUGINS:{let[,t]=e.data;this.log("<Enabling local plugins:>");for(let r of t)this.log(` ${r}`);this.runtime.setPluginList(t),this.postMessage([Oa.PLUGINS_CONFIGURED]);break}case sA.LOAD_BUNDLE:{let[,t]=e.data;this.log(`Loading bundle for app ${qT(t)}`);try{this.runtime.loadBundle(t),this.postMessage([Oa.BUNDLE_LOADED,this.runtime.getCallState().logs])}catch(r){this.postMessage([Oa.BUNDLE_LOAD_FAILED,void 0,r,this.runtime.getCallState().logs])}break}case sA.CALL:{let[,t,r,o,a,i]=e.data;this.log(`${t} \u2192 [Call] ${r}`);let m=i?await this.runtime.callBinary(r,o,a):await this.runtime.call(r,o,a);m.success?this.postMessage([Oa.RETURN,t,m.value,this.runtime.getCallState().logs]):Mz(m.error)?this.postMessage([Oa.CIRCUIT_BREAKER,t,m.value,m.error.cause]):this.postMessage([Oa.ERROR,t,m.error,this.runtime.getCallState().logs]);break}case sA.PLUGIN_RESPONSE:{let[,t,r]=e.data;this.runtime.onPluginResponse(t,r);break}case sA.QUIT:this.log("<Shutdown>"),this.runtime.quit();break}}function GT(e){var t;let r;e.reason instanceof Error?r=JT(e.reason):e.reason!=null&&(r=String(e.reason));let o=[...((t=this.runtime)==null?void 0:t.getCallState().logs)??[]];o.push({method:"error",args:[dA(e.reason)]}),this.postMessage([Oa.UNHANDLED_REJECTION,void 0,r,o])}function JT(e){return{cause:e.cause==null?void 0:String(e.cause),columnNumber:e.columnNumber,fileName:e.fileName,lineNumber:e.lineNumber,message:e.message,name:e.name,...e.stack&&{stack:e.stack}}}async function VT(){let e=globalThis.self??globalThis,t=new hv;PT(e,t),await t.init(),xT(e)}VT().catch(console.error);var HT=Object.freeze(Object.defineProperty({__proto__:null,QuickJSModuleCallbacks:Dz,QuickJSWASMModule:WN,applyBaseRuntimeOptions:Tz,applyModuleEvalRuntimeOptions:_z},Symbol.toStringTag,{value:"Module"}));
|
160027
|
+
`)))}catch(o){throw gi(this,ql,Im).call(this,o),o}}async callBinary(t,r,o){return await LT(Ae(this,Gm)[t],this.call.bind(this),t,r,o)}async call(t,r,o,a){return a?await this.callBinary(t,r,o):uo.withScopeAsync(async i=>{let m=i.manage(Ae(this,Ll).newContext()),A=Ae(this,bm);if(xr(this,Ml,!1),Ae(this,Mi).logs=[],!A)return{error:new Error("No actor loaded"),success:!1,value:void 0};let p=m.getProp(A,t),u=Ae(this,Jm).call(this,m,r),g={...Ae(this,Om),...o,...Ae(this,Um)},S=Ae(this,Jm).call(this,m,g),te=m.callFunction(p,A,u,S),ue;try{ue=m.unwrapResult(te)}catch(ot){return gi(this,ql,Im).call(this,ot),{error:ot,success:!1,value:void 0}}let De;try{[De]=await Promise.all([m.resolvePromise(ue),m.runtime.executePendingJobs()])}catch(ot){return gi(this,ql,Im).call(this,ot),{error:ot,success:!1,value:void 0}}let mt;try{mt=m.unwrapResult(De)}catch(ot){return gi(this,ql,Im).call(this,ot),{error:ot,success:!1,value:void 0}}let Rl=m.dump(mt);return Ae(this,Ml)?(Ae(this,Mi).logs=[],{error:h3(t),success:!1,value:void 0}):{error:void 0,success:!0,value:Rl}})}onPluginResponse(t,r){let o=Ae(this,vm)[t];if(o&&o.alive)if(r.success){let a=Ae(this,Ft).newString(JSON.stringify(r.value));o.resolve(a),Ae(this,Ft).runtime.executePendingJobs(),a.dispose()}else{let a=Ae(this,Ft).newError(r.error.message);o.reject(a),Ae(this,Ft).runtime.executePendingJobs(),a.dispose()}o.dispose(),delete Ae(this,vm)[t]}quit(){var t;Tl.log("[sandboxed runtime] quitting"),(t=Ae(this,bm))==null||t.dispose(),Ae(this,fm).dispose(),Ae(this,Ft).dispose(),Ae(this,Ll).dispose(),globalThis.close()}};Ll=new WeakMap,Ft=new WeakMap,fm=new WeakMap,bm=new WeakMap,Ml=new WeakMap,Mi=new WeakMap,Fl=new WeakMap,uv=new WeakMap,vm=new WeakMap,Om=new WeakMap,Um=new WeakMap,Gm=new WeakMap,Jm=new WeakMap,Vm=new WeakSet,mv=function(e,...t){for(let r of t)e.unwrapResult(e.evalCode(r,void 0,{type:"global"})).dispose()},nA=new WeakSet,bl=function(...e){let t=Ae(this,Ft);for(let r of e)t.unwrapResult(t.evalCode(r)).dispose()},pv=new WeakMap,fv=new WeakMap,bv=new WeakMap,vv=new WeakMap,Iv=new WeakMap,Cv=new WeakMap,ql=new WeakSet,Im=function(e){var t;Mz(e)||((t=Ae(this,Mi)).logs??(t.logs=[]),Ae(this,Mi).logs.push({method:"error",args:[dA(e)]}))};function FT(e){return e.hostname.split(".")[1]??e.hostname}function qT(e){var t,r;return`${FT(e)}@${(t=e.actor)==null?void 0:t.version} by ${(r=e.actor)==null?void 0:r.owner}`}function PT(e,t){Object.assign(e,{CircuitBreakerResponse:Up,log:OT,onmessage:UT,onunhandledrejection:GT,runtime:t})}function xT(e){e.postMessage([Oa.READY])}function OT(...e){this.debugLogging&&console.debug.apply(null,e)}async function UT(e){switch(e.data[0]){case sA.ENABLE_APP_LOGGING:this.runtime.enableAppLogging(),this.log("<App logs enabled>");break;case sA.ENABLE_DEBUG_LOGGING:this.debugLogging=!0,this.log("<Debug logs enabled>");break;case sA.ENABLE_PLUGINS:{let[,t]=e.data;this.log("<Enabling local plugins:>");for(let r of t)this.log(` ${r}`);this.runtime.setPluginList(t),this.postMessage([Oa.PLUGINS_CONFIGURED]);break}case sA.LOAD_BUNDLE:{let[,t]=e.data;this.log(`Loading bundle for app ${qT(t)}`);try{this.runtime.loadBundle(t),this.postMessage([Oa.BUNDLE_LOADED,this.runtime.getCallState().logs])}catch(r){this.postMessage([Oa.BUNDLE_LOAD_FAILED,void 0,r,this.runtime.getCallState().logs])}break}case sA.CALL:{let[,t,r,o,a,i]=e.data;this.log(`${t} \u2192 [Call] ${r}`);let m=i?await this.runtime.callBinary(r,o,a):await this.runtime.call(r,o,a);m.success?this.postMessage([Oa.RETURN,t,m.value,this.runtime.getCallState().logs]):Mz(m.error)?this.postMessage([Oa.CIRCUIT_BREAKER,t,m.value,m.error.cause]):this.postMessage([Oa.ERROR,t,m.error,this.runtime.getCallState().logs]);break}case sA.PLUGIN_RESPONSE:{let[,t,r]=e.data;this.runtime.onPluginResponse(t,r);break}case sA.QUIT:this.log("<Shutdown>"),this.runtime.quit();break}}function GT(e){var t;let r;e.reason instanceof Error?r=JT(e.reason):e.reason!=null&&(r=String(e.reason));let o=[...((t=this.runtime)==null?void 0:t.getCallState().logs)??[]];o.push({method:"error",args:[dA(e.reason)]}),this.postMessage([Oa.UNHANDLED_REJECTION,void 0,r,o])}function JT(e){return{cause:e.cause==null?void 0:String(e.cause),columnNumber:e.columnNumber,fileName:e.fileName,lineNumber:e.lineNumber,message:e.message,name:e.name,...e.stack&&{stack:e.stack}}}async function VT(){let e=globalThis.self??globalThis,t=new hv;PT(e,t),await t.init(),xT(e)}VT().catch(console.error);var HT=Object.freeze(Object.defineProperty({__proto__:null,QuickJSModuleCallbacks:Dz,QuickJSWASMModule:WN,applyBaseRuntimeOptions:Tz,applyModuleEvalRuntimeOptions:_z},Symbol.toStringTag,{value:"Module"}));
|
160028
160028
|
//# sourceMappingURL=browser-lite.worker.js.map
|