Updated Javascript and Wasm decoders with the correct

isVersionSupported() function.
This commit is contained in:
Ondrej Stava 2017-08-02 14:16:49 -07:00
parent 90577b3f08
commit 10af829784
3 changed files with 16 additions and 16 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -27,16 +27,16 @@ a+")";this.status=a}function La(c){function b(){if(!a.calledRun&&(a.calledRun=!0
(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}function gb(c,b){if(!b||!a.noExitRuntime){if(!a.noExitRuntime&&(oa=!0,T=vb,ka(hb),a.onExit))a.onExit(c);pa&&process.exit(c);a.quit(c,new na(c))}}function M(c){if(a.onAbort)a.onAbort(c);void 0!==c?(a.print(c),a.printErr(c),c=JSON.stringify(c)):c="";oa=!0;var b="abort("+c+") at "+ja()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";ib&& (a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}function gb(c,b){if(!b||!a.noExitRuntime){if(!a.noExitRuntime&&(oa=!0,T=vb,ka(hb),a.onExit))a.onExit(c);pa&&process.exit(c);a.quit(c,new na(c))}}function M(c){if(a.onAbort)a.onAbort(c);void 0!==c?(a.print(c),a.printErr(c),c=JSON.stringify(c)):c="";oa=!0;var b="abort("+c+") at "+ja()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";ib&&
ib.forEach(function(a){b=a(b,c)});throw b;}function v(){}function E(a){return(a||v).__cache__}function Y(a,b){var c=E(b),g=c[a];if(g)return g;g=Object.create((b||v).prototype);g.ptr=a;return c[a]=g}function Z(a){if("string"===typeof a){a=ra(a);var b=h.alloc(a,N);h.copy(a,N,b);return b}return a}function D(){throw"cannot construct a Status, no constructor in IDL";}function I(){this.ptr=wb();E(I)[this.ptr]=this}function J(){this.ptr=xb();E(J)[this.ptr]=this}function p(){this.ptr=yb();E(p)[this.ptr]= ib.forEach(function(a){b=a(b,c)});throw b;}function v(){}function E(a){return(a||v).__cache__}function Y(a,b){var c=E(b),g=c[a];if(g)return g;g=Object.create((b||v).prototype);g.ptr=a;return c[a]=g}function Z(a){if("string"===typeof a){a=ra(a);var b=h.alloc(a,N);h.copy(a,N,b);return b}return a}function D(){throw"cannot construct a Status, no constructor in IDL";}function I(){this.ptr=wb();E(I)[this.ptr]=this}function J(){this.ptr=xb();E(J)[this.ptr]=this}function p(){this.ptr=yb();E(p)[this.ptr]=
this}function O(){this.ptr=zb();E(O)[this.ptr]=this}function B(){this.ptr=Ab();E(B)[this.ptr]=this}function q(){this.ptr=Bb();E(q)[this.ptr]=this}function K(){this.ptr=Cb();E(K)[this.ptr]=this}function V(){this.ptr=Db();E(V)[this.ptr]=this}function P(){this.ptr=Eb();E(P)[this.ptr]=this}function l(){this.ptr=Fb();E(l)[this.ptr]=this}function F(){this.ptr=Gb();E(F)[this.ptr]=this}function aa(){throw"cannot construct a VoidPtr, no constructor in IDL";}function L(){this.ptr=Hb();E(L)[this.ptr]=this}function Q(){this.ptr= this}function O(){this.ptr=zb();E(O)[this.ptr]=this}function B(){this.ptr=Ab();E(B)[this.ptr]=this}function q(){this.ptr=Bb();E(q)[this.ptr]=this}function K(){this.ptr=Cb();E(K)[this.ptr]=this}function V(){this.ptr=Db();E(V)[this.ptr]=this}function P(){this.ptr=Eb();E(P)[this.ptr]=this}function l(){this.ptr=Fb();E(l)[this.ptr]=this}function F(){this.ptr=Gb();E(F)[this.ptr]=this}function aa(){throw"cannot construct a VoidPtr, no constructor in IDL";}function L(){this.ptr=Hb();E(L)[this.ptr]=this}function Q(){this.ptr=
Ib();E(Q)[this.ptr]=this}var a=e=e||{},jb=!1,kb=!1;a.onRuntimeInitialized=function(){jb=!0;if(kb&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){kb=!0;if(jb&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3<a.length||0<a[0]||9<a[1]?!1:!0};a||(a=("undefined"!==typeof e?e:null)||{});var wa={},da;for(da in a)a.hasOwnProperty(da)&&(wa[da]=a[da]);var xa=!1, Ib();E(Q)[this.ptr]=this}var a=e=e||{},jb=!1,kb=!1;a.onRuntimeInitialized=function(){jb=!0;if(kb&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){kb=!0;if(jb&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3<a.length?!1:1==a[0]&&0==a[1]?!0:0!=a[0]||10<a[1]?!1:!0};a||(a=("undefined"!==typeof e?e:null)||{});var wa={},da;for(da in a)a.hasOwnProperty(da)&&
ha=!1,pa=!1,Ba=!1;if(a.ENVIRONMENT)if("WEB"===a.ENVIRONMENT)xa=!0;else if("WORKER"===a.ENVIRONMENT)ha=!0;else if("NODE"===a.ENVIRONMENT)pa=!0;else if("SHELL"===a.ENVIRONMENT)Ba=!0;else throw Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");else xa="object"===typeof window,ha="function"===typeof importScripts,pa="object"===typeof process&&"function"===typeof require&&!xa&&!ha,Ba=!xa&&!pa&&!ha;if(pa){a.print||(a.print=console.log);a.printErr|| (wa[da]=a[da]);var xa=!1,ha=!1,pa=!1,Ba=!1;if(a.ENVIRONMENT)if("WEB"===a.ENVIRONMENT)xa=!0;else if("WORKER"===a.ENVIRONMENT)ha=!0;else if("NODE"===a.ENVIRONMENT)pa=!0;else if("SHELL"===a.ENVIRONMENT)Ba=!0;else throw Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");else xa="object"===typeof window,ha="function"===typeof importScripts,pa="object"===typeof process&&"function"===typeof require&&!xa&&!ha,Ba=!xa&&!pa&&!ha;if(pa){a.print||(a.print=
(a.printErr=console.warn);var Na,Oa;a.read=function(a,b){Na||(Na=require("fs"));Oa||(Oa=require("path"));a=Oa.normalize(a);a=Na.readFileSync(a);return b?a:a.toString()};a.readBinary=function(c){c=a.read(c,!0);c.buffer||(c=new Uint8Array(c));f(c.buffer);return c};a.load=function(a){m(read(a))};a.thisProgram||(a.thisProgram=1<process.argv.length?process.argv[1].replace(/\\/g,"/"):"unknown-program");a.arguments=process.argv.slice(2);"undefined"!==typeof module&&(module.exports=a);process.on("uncaughtException", console.log);a.printErr||(a.printErr=console.warn);var Na,Oa;a.read=function(a,b){Na||(Na=require("fs"));Oa||(Oa=require("path"));a=Oa.normalize(a);a=Na.readFileSync(a);return b?a:a.toString()};a.readBinary=function(c){c=a.read(c,!0);c.buffer||(c=new Uint8Array(c));f(c.buffer);return c};a.load=function(a){m(read(a))};a.thisProgram||(a.thisProgram=1<process.argv.length?process.argv[1].replace(/\\/g,"/"):"unknown-program");a.arguments=process.argv.slice(2);"undefined"!==typeof module&&(module.exports=
function(a){if(!(a instanceof na))throw a;});a.inspect=function(){return"[Emscripten Module object]"}}else if(Ba)a.print||(a.print=print),"undefined"!=typeof printErr&&(a.printErr=printErr),a.read="undefined"!=typeof read?read:function(){throw"no read() available";},a.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");f("object"===typeof a);return a},"undefined"!=typeof scriptArgs?a.arguments=scriptArgs:"undefined"!=typeof arguments&&(a.arguments= a);process.on("uncaughtException",function(a){if(!(a instanceof na))throw a;});a.inspect=function(){return"[Emscripten Module object]"}}else if(Ba)a.print||(a.print=print),"undefined"!=typeof printErr&&(a.printErr=printErr),a.read="undefined"!=typeof read?read:function(){throw"no read() available";},a.readBinary=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");f("object"===typeof a);return a},"undefined"!=typeof scriptArgs?a.arguments=scriptArgs:
arguments),"function"===typeof quit&&(a.quit=function(a,b){quit(a)});else if(xa||ha)a.read=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},ha&&(a.readBinary=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),a.readAsync=function(a,b,d){var c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(){200==c.status||0==c.status&&c.response?b(c.response): "undefined"!=typeof arguments&&(a.arguments=arguments),"function"===typeof quit&&(a.quit=function(a,b){quit(a)});else if(xa||ha)a.read=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);return b.responseText},ha&&(a.readBinary=function(a){var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),a.readAsync=function(a,b,d){var c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(){200==
d()};c.onerror=d;c.send(null)},"undefined"!=typeof arguments&&(a.arguments=arguments),"undefined"!==typeof console?(a.print||(a.print=function(a){console.log(a)}),a.printErr||(a.printErr=function(a){console.warn(a)})):a.print||(a.print=function(a){}),ha&&(a.load=importScripts),"undefined"===typeof a.setWindowTitle&&(a.setWindowTitle=function(a){document.title=a});else throw"Unknown runtime environment. Where are we?";!a.load&&a.read&&(a.load=function(c){m(a.read(c))});a.print||(a.print=function(){}); c.status||0==c.status&&c.response?b(c.response):d()};c.onerror=d;c.send(null)},"undefined"!=typeof arguments&&(a.arguments=arguments),"undefined"!==typeof console?(a.print||(a.print=function(a){console.log(a)}),a.printErr||(a.printErr=function(a){console.warn(a)})):a.print||(a.print=function(a){}),ha&&(a.load=importScripts),"undefined"===typeof a.setWindowTitle&&(a.setWindowTitle=function(a){document.title=a});else throw"Unknown runtime environment. Where are we?";!a.load&&a.read&&(a.load=function(c){m(a.read(c))});
a.printErr||(a.printErr=a.print);a.arguments||(a.arguments=[]);a.thisProgram||(a.thisProgram="./this.program");a.quit||(a.quit=function(a,b){throw b;});a.print=a.print;a.printErr=a.printErr;a.preRun=[];a.postRun=[];for(da in wa)wa.hasOwnProperty(da)&&(a[da]=wa[da]);wa=void 0;var n={setTempRet0:function(a){return tempRet0=a},getTempRet0:function(){return tempRet0},stackSave:function(){return T},stackRestore:function(a){T=a},getNativeTypeSize:function(a){switch(a){case "i1":case "i8":return 1;case "i16":return 2; a.print||(a.print=function(){});a.printErr||(a.printErr=a.print);a.arguments||(a.arguments=[]);a.thisProgram||(a.thisProgram="./this.program");a.quit||(a.quit=function(a,b){throw b;});a.print=a.print;a.printErr=a.printErr;a.preRun=[];a.postRun=[];for(da in wa)wa.hasOwnProperty(da)&&(a[da]=wa[da]);wa=void 0;var n={setTempRet0:function(a){return tempRet0=a},getTempRet0:function(){return tempRet0},stackSave:function(){return T},stackRestore:function(a){T=a},getNativeTypeSize:function(a){switch(a){case "i1":case "i8":return 1;
case "i32":return 4;case "i64":return 8;case "float":return 4;case "double":return 8;default:return"*"===a[a.length-1]?n.QUANTUM_SIZE:"i"===a[0]?(a=parseInt(a.substr(1)),f(0===a%8),a/8):0}},getNativeFieldSize:function(a){return Math.max(n.getNativeTypeSize(a),n.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(a,b){"double"===b||"i64"===b?a&7&&(f(4===(a&7)),a+=4):f(0===(a&3));return a},getAlignSize:function(a,b,d){return d||"i64"!=a&&"double"!=a?a?Math.min(b||(a?n.getNativeFieldSize(a):0),n.QUANTUM_SIZE): case "i16":return 2;case "i32":return 4;case "i64":return 8;case "float":return 4;case "double":return 8;default:return"*"===a[a.length-1]?n.QUANTUM_SIZE:"i"===a[0]?(a=parseInt(a.substr(1)),f(0===a%8),a/8):0}},getNativeFieldSize:function(a){return Math.max(n.getNativeTypeSize(a),n.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(a,b){"double"===b||"i64"===b?a&7&&(f(4===(a&7)),a+=4):f(0===(a&3));return a},getAlignSize:function(a,b,d){return d||"i64"!=a&&"double"!=a?a?Math.min(b||(a?n.getNativeFieldSize(a):
Math.min(b,8):8},dynCall:function(c,b,d){return d&&d.length?a["dynCall_"+c].apply(null,[b].concat(d)):a["dynCall_"+c].call(null,b)},functionPointers:[],addFunction:function(a){for(var b=0;b<n.functionPointers.length;b++)if(!n.functionPointers[b])return n.functionPointers[b]=a,2*(1+b);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.";},removeFunction:function(a){n.functionPointers[(a-2)/2]=null},warnOnce:function(c){n.warnOnce.shown||(n.warnOnce.shown= 0),n.QUANTUM_SIZE):Math.min(b,8):8},dynCall:function(c,b,d){return d&&d.length?a["dynCall_"+c].apply(null,[b].concat(d)):a["dynCall_"+c].call(null,b)},functionPointers:[],addFunction:function(a){for(var b=0;b<n.functionPointers.length;b++)if(!n.functionPointers[b])return n.functionPointers[b]=a,2*(1+b);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.";},removeFunction:function(a){n.functionPointers[(a-2)/2]=null},warnOnce:function(c){n.warnOnce.shown||
{});n.warnOnce.shown[c]||(n.warnOnce.shown[c]=1,a.printErr(c))},funcWrappers:{},getFuncWrapper:function(a,b){f(b);n.funcWrappers[b]||(n.funcWrappers[b]={});var c=n.funcWrappers[b];c[a]||(c[a]=1===b.length?function(){return n.dynCall(b,a)}:2===b.length?function(c){return n.dynCall(b,a,[c])}:function(){return n.dynCall(b,a,Array.prototype.slice.call(arguments))});return c[a]},getCompilerSetting:function(a){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"; (n.warnOnce.shown={});n.warnOnce.shown[c]||(n.warnOnce.shown[c]=1,a.printErr(c))},funcWrappers:{},getFuncWrapper:function(a,b){f(b);n.funcWrappers[b]||(n.funcWrappers[b]={});var c=n.funcWrappers[b];c[a]||(c[a]=1===b.length?function(){return n.dynCall(b,a)}:2===b.length?function(c){return n.dynCall(b,a,[c])}:function(){return n.dynCall(b,a,Array.prototype.slice.call(arguments))});return c[a]},getCompilerSetting:function(a){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work";
},stackAlloc:function(a){var b=T;T=T+a|0;T=T+15&-16;return b},staticAlloc:function(a){var b=W;W=W+a|0;W=W+15&-16;return b},dynamicAlloc:function(a){var b=u[X>>2];a=(b+a+15|0)&-16;u[X>>2]=a;return a>=y&&!Va()?(u[X>>2]=b,0):b},alignMemory:function(a,b){return Math.ceil(a/(b?b:16))*(b?b:16)},makeBigInt:function(a,b,d){return d?+(a>>>0)+4294967296*+(b>>>0):+(a>>>0)+4294967296*+(b|0)},GLOBAL_BASE:1024,QUANTUM_SIZE:4,__dummy__:0},oa=0;(function(){function a(a){a=a.toString().match(e).slice(1);return{arguments:a[0], },stackAlloc:function(a){var b=T;T=T+a|0;T=T+15&-16;return b},staticAlloc:function(a){var b=W;W=W+a|0;W=W+15&-16;return b},dynamicAlloc:function(a){var b=u[X>>2];a=(b+a+15|0)&-16;u[X>>2]=a;return a>=y&&!Va()?(u[X>>2]=b,0):b},alignMemory:function(a,b){return Math.ceil(a/(b?b:16))*(b?b:16)},makeBigInt:function(a,b,d){return d?+(a>>>0)+4294967296*+(b>>>0):+(a>>>0)+4294967296*+(b|0)},GLOBAL_BASE:1024,QUANTUM_SIZE:4,__dummy__:0},oa=0;(function(){function a(a){a=a.toString().match(e).slice(1);return{arguments:a[0],
body:a[1],returnValue:a[2]}}function b(){if(!f){f={};for(var b in d)d.hasOwnProperty(b)&&(f[b]=a(d[b]))}}var d={stackSave:function(){n.stackSave()},stackRestore:function(){n.stackRestore()},arrayToC:function(a){var b=n.stackAlloc(a.length);N.set(a,b);return b},stringToC:function(a){var b=0;if(null!==a&&void 0!==a&&0!==a){var c=(a.length<<2)+1;b=n.stackAlloc(c);Ea(a,G,b,c)}return b}},e=/^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,f=null;cwrap=function(c, body:a[1],returnValue:a[2]}}function b(){if(!f){f={};for(var b in d)d.hasOwnProperty(b)&&(f[b]=a(d[b]))}}var d={stackSave:function(){n.stackSave()},stackRestore:function(){n.stackRestore()},arrayToC:function(a){var b=n.stackAlloc(a.length);N.set(a,b);return b},stringToC:function(a){var b=0;if(null!==a&&void 0!==a&&0!==a){var c=(a.length<<2)+1;b=n.stackAlloc(c);Ea(a,G,b,c)}return b}},e=/^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,f=null;cwrap=function(c,
d,e){e=e||[];var g=A(c);c=e.every(function(a){return"number"===a});var h="string"!==d;if(h&&c)return g;var k=e.map(function(a,b){return"$"+b});d="(function("+k.join(",")+") {";var l=e.length;if(!c){b();d+="var stack = "+f.stackSave.body+";";for(var m=0;m<l;m++){var n=k[m],x=e[m];"number"!==x&&(x=f[x+"ToC"],d+="var "+x.arguments+" = "+n+";",d+=x.body+";",d+=n+"=("+x.returnValue+");")}}e=a(function(){return g}).returnValue;d+="var ret = "+e+"("+k.join(",")+");";h||(e=a(function(){return t}).returnValue, d,e){e=e||[];var g=A(c);c=e.every(function(a){return"number"===a});var h="string"!==d;if(h&&c)return g;var k=e.map(function(a,b){return"$"+b});d="(function("+k.join(",")+") {";var l=e.length;if(!c){b();d+="var stack = "+f.stackSave.body+";";for(var m=0;m<l;m++){var n=k[m],x=e[m];"number"!==x&&(x=f[x+"ToC"],d+="var "+x.arguments+" = "+n+";",d+=x.body+";",d+=n+"=("+x.returnValue+");")}}e=a(function(){return g}).returnValue;d+="var ret = "+e+"("+k.join(",")+");";h||(e=a(function(){return t}).returnValue,