
ebSite.0.0.29.source-code.49d639ce7c201cfb5909.worker.js Maven / Gradle / Ivy
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=0)}([function(e,t,r){"use strict";function n(){var e,t,r=(e=["native method print ( any value ) { JavaScript: console.log(value.toString()); }"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return n=function(){return r},r}r.r(t);var o=self;o.Honey={requirePath:[".."]},o.importScripts("/js/lib/require.js","/js/lib/prompto.core.bundle.js");var a=o.prompto;function i(e,t){return new(0,a.parser[t+"CleverParser"])(e).parse()}function l(e){return o.replContext=o.librariesContext.newLocalContext(),{toStdOut:""}}var s={translate:function(e){var t=e.data,r=o.librariesContext.clone(),n=i(t.content,t.from);n.register(r);var l=a.parser.Dialect[t.to],s=new a.utils.CodeWriter(l,r);return n.toDialect(s),{translated:s.toString()}},execute:function(e){console.log=function(t){postMessage({inResponseTo:e.id,keepHandlerAlive:!0,data:{toStdOut:t}})},console.error=function(t){postMessage({inResponseTo:e.id,keepHandlerAlive:!0,data:{toStdErr:t}})};var t=e.data,r=o.librariesContext.clone();console.log("Running sample...\n");var n=i(t.content,t.dialect);n.register(r);var l=null;return n.forEach(function(e){e instanceof a.declaration.TestMethodDeclaration&&(l=e.name)}),a.store.$DataStore.instance=new a.memstore.MemStore,l?a.runtime.Interpreter.interpretTest(r,l):a.runtime.Interpreter.interpret(r,"main",""),{toStdOut:"Success!\n"}},deleteRepl:function(e){var t=e.data.name,r=o.replContext.getRegistered(t);return r?r.unregister?(r instanceof a.runtime.MethodDeclarationMap?delete o.replContext.declarations[t]:r.unregister(o.replContext),{toStdOut:"Deleted declaration "+t}):(delete o.replContext.instances[t],delete o.replContext.values[t],{toStdOut:"Deleted variable "+t}):{toStdErr:"Not found: "+t}},resetRepl:l,showRepl:function(e){var t=[],r=a.parser.Dialect[e.data.dialect];for(var n in o.replContext.declarations){var i=o.replContext.declarations[n];(i instanceof a.runtime.MethodDeclarationMap?i.getAll():[i]).forEach(function(e){var n=new a.utils.CodeWriter(r,o.replContext);e.toDialect(n),t.push(n.toString())})}for(n in o.replContext.values){var l=o.replContext.values[n];t.push(n+": "+l.toString())}return t.length>0?{items:t}:{toStdOut:"",items:[]}},repl:function(e){var t=new(0,a.parser[e.data.dialect+"CleverParser"])(e.data.input);t.removeErrorListeners(),t.addErrorListener(new a.problem.ProblemListener);try{var r=t.parse_repl_input();if(r instanceof a.declaration.Declaration)return r.register(o.replContext),{toStdOut:"Registered "+r.name};if(r.interpret){var n=r.interpret(o.replContext);return n?{toStdOut:n.toString()}:{toStdOut:""}}return{toStdErr:"Unsupported:"+e.data.input}}catch(i){return{toStdErr:i.message}}}};onmessage=function(e){var t=e.data,r=(0,s[t.verb])(t),n={inResponseTo:t.id,data:r};postMessage(n)},o.librariesContext=a.runtime.Context.newGlobalsContext(),l(),function(e,t){var r=new XMLHttpRequest;r.onerror=function(e){return console.log("Error "+e.target.status+" occurred while receiving the document."),null},r.onload=function(e){t(r.responseText)},r.open("GET",e),"/"!==e[0]&&"."!==e[0]&&r.setRequestHeader("Access-Control-Allow-Origin","*"),r.send(null)}("/prompto/prompto.pec",function(e){var t=i(e,"E");t.register(o.librariesContext);o.librariesContext.unregisterMethodDeclaration({name:"print"},"any"),(t=i(e=String.raw(n()),"O")).register(o.librariesContext)})}]);
//# sourceMappingURL=49d639ce7c201cfb5909.worker.js.map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy