pxt-common-packages
Version:
Microsoft MakeCode (PXT) common packages
1,175 lines (1,027 loc) • 32.9 kB
JavaScript
// total=32845 new=93.49% cached=0.00% other=6.51%
(function (ectx) {
'use strict';
const runtime = ectx.runtime;
const oops = ectx.oops;
const doNothing = ectx.doNothing;
const pxsim = ectx.pxsim;
const globals = ectx.globals;
const maybeYield = ectx.maybeYield;
const setupDebugger = ectx.setupDebugger;
const isBreakFrame = ectx.isBreakFrame;
const breakpoint = ectx.breakpoint;
const trace = ectx.trace;
const checkStack = ectx.checkStack;
const leave = ectx.leave;
const checkResumeConsumed = ectx.checkResumeConsumed;
const setupResume = ectx.setupResume;
const setupLambda = ectx.setupLambda;
const checkSubtype = ectx.checkSubtype;
const failedCast = ectx.failedCast;
const buildResume = ectx.buildResume;
const mkVTable = ectx.mkVTable;
const bind = ectx.bind;
const leaveAccessor = ectx.leaveAccessor;
const __this = runtime;
const pxtrt = pxsim.pxtrt;
let yieldSteps = 1;
ectx.setupYield(function() { yieldSteps = 100; })
pxsim.setTitle("net");
pxsim.setConfigData({}, {});
pxtrt.mapKeyNames = [
""
];
__this.setupPerfCounters([]);
const pxsim_Array__getAt = pxsim.Array_.getAt;
const pxsim_Array__length = pxsim.Array_.length;
const pxsim_Array__mk = pxsim.Array_.mk;
const pxsim_Array__push = pxsim.Array_.push;
const pxsim_Boolean__bang = pxsim.Boolean_.bang;
const pxsim_String__concat = pxsim.String_.concat;
const pxsim_String__stringConv = pxsim.String_.stringConv;
const pxsim_numops_toBool = pxsim.numops.toBool;
const pxsim_numops_toBoolDecr = pxsim.numops.toBoolDecr;
const pxsim_pxtcore_mkAction = pxsim.pxtcore.mkAction;
const pxsim_pxtcore_mkClassInstance = pxsim.pxtcore.mkClassInstance;
const pxsim_pxtrt_ldlocRef = pxsim.pxtrt.ldlocRef;
const pxsim_pxtrt_mapGetByString = pxsim.pxtrt.mapGetByString;
const pxsim_pxtrt_stclo = pxsim.pxtrt.stclo;
const pxsim_pxtrt_stlocRef = pxsim.pxtrt.stlocRef;
const pxsim_Boolean_ = pxsim.Boolean_;
const pxsim_pxtcore = pxsim.pxtcore;
const pxsim_String_ = pxsim.String_;
const pxsim_ImageMethods = pxsim.ImageMethods;
const pxsim_Array_ = pxsim.Array_;
const pxsim_pxtrt = pxsim.pxtrt;
const pxsim_numops = pxsim.numops;
function _main___P109993(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
globals._intervals___110236 = (undefined);
globals._pollEventQueue___110249 = (undefined);
globals.RUN_KEY___110432 = ("#run");
globals.SCOPE_KEY___110433 = ("#scope");
s.tmp_0 = settings_initScopes__P110445_mk(s);
s.callLocIdx = 13; s.pc = 1; return s.tmp_0;
case 1:
r0 = s.retval;
r0 = undefined;
return leave(s, r0)
default: oops()
} } }
_main___P109993.info = {"start":0,"length":0,"line":0,"column":0,"endLine":0,"endColumn":0,"fileName":"requests.ts","functionName":"<main>","argumentNames":[]}
_main___P109993.continuations = [ ]
function _main___P109993_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: _main___P109993, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
} }
function settings_initScopes__P110445(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
s.rn___110583 = undefined;
s.tmp_1 = settings_runNumber__P110443_mk(s);
s.callLocIdx = 10; s.pc = 1; return s.tmp_1;
case 1:
r0 = s.retval;
s.tmp_0 = r0;
r0 = (s.tmp_0 + 1);
s.rn___110583 = (r0);
s.tmp_0 = settings_writeNumber__P110451_mk(s);
s.tmp_0.arg0 = globals.RUN_KEY___110432;
s.tmp_0.arg1 = s.rn___110583;
s.callLocIdx = 11; s.pc = 2; return s.tmp_0;
case 2:
r0 = s.retval;
r0 = pxsim.control.deviceSerialNumber();
s.tmp_1 = r0;
r0 = (s.tmp_1 & 2147483647);
s.tmp_0 = r0;
r0 = pxsim_pxtcore.seedAddRandom(s.tmp_0);
r0 = pxsim_pxtcore.seedAddRandom(s.rn___110583);
s.tmp_0 = settings_setScope__P110444_mk(s);
r0 = pxsim_pxtcore.programName();
s.tmp_0.arg0 = r0;
s.callLocIdx = 12; s.pc = 3; return s.tmp_0;
case 3:
r0 = s.retval;
r0 = undefined;
return leave(s, r0)
default: oops()
} } }
settings_initScopes__P110445.info = {"start":1104,"length":230,"line":41,"column":4,"endLine":49,"endColumn":5,"fileName":"pxt_modules/settings/settings.ts","functionName":"initScopes","argumentNames":[]}
function settings_initScopes__P110445_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: settings_initScopes__P110445, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
tmp_1: undefined,
rn___110583: undefined,
} }
function settings_setScope__P110444(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
s.currScope___110613 = undefined;
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.lambdaArgs = null;
}
r0 = pxsim_numops_toBoolDecr(s.arg0);
s.tmp_1 = r0;
r0 = pxsim_Boolean__bang(s.tmp_1);
s.tmp_0 = r0;
r0 = pxsim_numops_toBool(s.tmp_0);
if (!r0) { step = 1; continue; }
r0 = s.tmp_0;
{ step = 2; continue; }
case 1:
r0 = pxsim_String_.length(s.arg0);
s.tmp_2 = r0;
r0 = (s.tmp_2 > 100);
case 2:
// jmp value (already in r0)
s.tmp_3 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_3);
if (!r0) { step = 3; continue; }
r0 = pxsim_pxtrt.panic(922);
case 3:
case 4:
s.tmp_0 = settings_readString__P110454_mk(s);
s.tmp_0.arg0 = globals.SCOPE_KEY___110433;
s.callLocIdx = 8; s.pc = 7; return s.tmp_0;
case 7:
r0 = s.retval;
s.currScope___110613 = (r0);
r0 = (s.currScope___110613 != s.arg0);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 5; continue; }
r0 = pxsim.settings._userClean();
s.tmp_0 = settings_writeString__P110449_mk(s);
s.tmp_0.arg0 = globals.SCOPE_KEY___110433;
s.tmp_0.arg1 = s.arg0;
s.callLocIdx = 9; s.pc = 8; return s.tmp_0;
case 8:
r0 = s.retval;
case 5:
case 6:
r0 = undefined;
return leave(s, r0)
default: oops()
} } }
settings_setScope__P110444.info = {"start":826,"length":272,"line":31,"column":4,"endLine":39,"endColumn":5,"fileName":"pxt_modules/settings/settings.ts","functionName":"setScope","argumentNames":["scope"]}
function settings_setScope__P110444_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: settings_setScope__P110444, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
tmp_1: undefined,
tmp_2: undefined,
tmp_3: undefined,
currScope___110613: undefined,
arg0: undefined,
} }
function settings_writeString__P110449(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.arg1 = (s.lambdaArgs[1]);
s.lambdaArgs = null;
}
s.tmp_0 = settings_writeBuffer__P110448_mk(s);
s.tmp_0.arg0 = s.arg0;
r0 = pxsim.control.createBufferFromUTF8(s.arg1);
s.tmp_0.arg1 = r0;
s.callLocIdx = 14; s.pc = 1; return s.tmp_0;
case 1:
r0 = s.retval;
r0 = undefined;
return leave(s, r0)
default: oops()
} } }
settings_writeString__P110449.info = {"start":1895,"length":125,"line":75,"column":4,"endLine":77,"endColumn":5,"fileName":"pxt_modules/settings/settings.ts","functionName":"writeString","argumentNames":["key","value"]}
function settings_writeString__P110449_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: settings_writeString__P110449, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
arg0: undefined,
arg1: undefined,
} }
function settings_writeBuffer__P110448(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.arg1 = (s.lambdaArgs[1]);
s.lambdaArgs = null;
}
r0 = pxsim.settings._set(s.arg0, s.arg1);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 1; continue; }
r0 = pxsim.settings._userClean();
r0 = pxsim_pxtrt.panic(920);
case 1:
case 2:
r0 = undefined;
return leave(s, r0)
default: oops()
} } }
settings_writeBuffer__P110448.info = {"start":1538,"length":290,"line":63,"column":4,"endLine":70,"endColumn":5,"fileName":"pxt_modules/settings/settings.ts","functionName":"writeBuffer","argumentNames":["key","value"]}
function settings_writeBuffer__P110448_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: settings_writeBuffer__P110448, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
arg0: undefined,
arg1: undefined,
} }
function settings_readString__P110454(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
s.buf___110644 = undefined;
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.lambdaArgs = null;
}
r0 = pxsim.settings._get(s.arg0);
s.buf___110644 = (r0);
r0 = pxsim_numops_toBoolDecr(s.buf___110644);
s.tmp_1 = r0;
r0 = pxsim_Boolean__bang(s.tmp_1);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 1; continue; }
r0 = undefined;
{ step = 3; continue; }
{ step = 2; continue; }
case 1:
r0 = pxsim.BufferMethods.toString(s.buf___110644);
{ step = 3; continue; }
case 2:
r0 = undefined;
case 3:
return leave(s, r0)
default: oops()
} } }
settings_readString__P110454.info = {"start":2827,"length":177,"line":110,"column":4,"endLine":116,"endColumn":5,"fileName":"pxt_modules/settings/settings.ts","functionName":"readString","argumentNames":["key"]}
function settings_readString__P110454_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: settings_readString__P110454, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
tmp_1: undefined,
buf___110644: undefined,
arg0: undefined,
} }
function settings_readBuffer__P110453(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.lambdaArgs = null;
}
r0 = pxsim.settings._get(s.arg0);
return leave(s, r0)
default: oops()
} } }
settings_readBuffer__P110453.info = {"start":2694,"length":72,"line":103,"column":4,"endLine":105,"endColumn":5,"fileName":"pxt_modules/settings/settings.ts","functionName":"readBuffer","argumentNames":["key"]}
function settings_readBuffer__P110453_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: settings_readBuffer__P110453, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
arg0: undefined,
} }
function settings_writeNumber__P110451(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.arg1 = (s.lambdaArgs[1]);
s.lambdaArgs = null;
}
r0 = pxsim_Array__mk();
s.tmp_0 = r0;
r0 = pxsim_Array__push(s.tmp_0, s.arg1);
s.tmp_1 = settings_writeBuffer__P110448_mk(s);
s.tmp_1.arg0 = s.arg0;
s.tmp_2 = msgpack_packNumberArray__P110137_mk(s);
s.tmp_2.arg0 = s.tmp_0;
s.callLocIdx = 15; s.pc = 2; return s.tmp_2;
case 2:
r0 = s.retval;
s.tmp_1.arg1 = r0;
s.callLocIdx = 16; s.pc = 1; return s.tmp_1;
case 1:
r0 = s.retval;
r0 = undefined;
return leave(s, r0)
default: oops()
} } }
settings_writeNumber__P110451.info = {"start":2265,"length":122,"line":89,"column":4,"endLine":91,"endColumn":5,"fileName":"pxt_modules/settings/settings.ts","functionName":"writeNumber","argumentNames":["key","value"]}
function settings_writeNumber__P110451_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: settings_writeNumber__P110451, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
tmp_1: undefined,
tmp_2: undefined,
arg0: undefined,
arg1: undefined,
} }
function msgpack_packNumberArray__P110137(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
s.off___110667 = undefined;
s.n___110669 = undefined;
s.unnamed312___U2 = undefined;
s.unnamed313___U3 = undefined;
s.buf___110679 = undefined;
s.n___110685 = undefined;
s.unnamed314___U6 = undefined;
s.unnamed315___U7 = undefined;
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.lambdaArgs = null;
}
s.off___110667 = (0);
s.n___110669 = (undefined);
s.unnamed312___U2 = (s.arg0);
s.unnamed313___U3 = (0);
case 1:
s.tmp_0 = r0 = s.unnamed313___U3;
r0 = pxsim_Array__length(s.unnamed312___U2);
s.tmp_1 = r0;
r0 = (s.tmp_0 < s.tmp_1);
if (!r0) { step = 2; continue; }
r0 = pxsim_Array__getAt(s.unnamed312___U2, s.unnamed313___U3);
s.n___110669 = (r0);
s.tmp_2 = r0 = s.off___110667;
s.tmp_4 = msgpack_packNumberCore__P110135_mk(s);
s.tmp_4.arg0 = null;
s.tmp_4.arg1 = s.off___110667;
s.tmp_4.arg2 = s.n___110669;
s.callLocIdx = 5; s.pc = 5; return s.tmp_4;
case 5:
r0 = s.retval;
s.tmp_3 = r0;
r0 = (s.tmp_2 + s.tmp_3);
s.off___110667 = (r0);
r0 = (s.unnamed313___U3 + 1);
s.unnamed313___U3 = (r0);
{ step = 1; continue; }
case 2:
s.unnamed312___U2 = (undefined);
r0 = pxsim.control.createBuffer(s.off___110667);
s.buf___110679 = (r0);
s.off___110667 = (0);
s.n___110685 = (undefined);
s.unnamed314___U6 = (s.arg0);
s.unnamed315___U7 = (0);
case 3:
s.tmp_0 = r0 = s.unnamed315___U7;
r0 = pxsim_Array__length(s.unnamed314___U6);
s.tmp_1 = r0;
r0 = (s.tmp_0 < s.tmp_1);
if (!r0) { step = 4; continue; }
r0 = pxsim_Array__getAt(s.unnamed314___U6, s.unnamed315___U7);
s.n___110685 = (r0);
s.tmp_2 = r0 = s.off___110667;
s.tmp_4 = msgpack_packNumberCore__P110135_mk(s);
s.tmp_4.arg0 = s.buf___110679;
s.tmp_4.arg1 = s.off___110667;
s.tmp_4.arg2 = s.n___110685;
s.callLocIdx = 6; s.pc = 6; return s.tmp_4;
case 6:
r0 = s.retval;
s.tmp_3 = r0;
r0 = (s.tmp_2 + s.tmp_3);
s.off___110667 = (r0);
r0 = (s.unnamed315___U7 + 1);
s.unnamed315___U7 = (r0);
{ step = 3; continue; }
case 4:
s.unnamed314___U6 = (undefined);
r0 = s.buf___110679;
return leave(s, r0)
default: oops()
} } }
msgpack_packNumberArray__P110137.info = {"start":3427,"length":330,"line":117,"column":4,"endLine":128,"endColumn":5,"fileName":"pxt_modules/base/buffer.ts","functionName":"packNumberArray","argumentNames":["nums"]}
function msgpack_packNumberArray__P110137_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: msgpack_packNumberArray__P110137, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
tmp_1: undefined,
tmp_2: undefined,
tmp_3: undefined,
tmp_4: undefined,
off___110667: undefined,
n___110669: undefined,
unnamed312___U2: undefined,
unnamed313___U3: undefined,
buf___110679: undefined,
n___110685: undefined,
unnamed314___U6: undefined,
unnamed315___U7: undefined,
arg0: undefined,
} }
function msgpack_packNumberCore__P110135(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
s.tag___110699 = undefined;
s.fmt___110742 = undefined;
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.arg1 = (s.lambdaArgs[1]);
s.arg2 = (s.lambdaArgs[2]);
s.lambdaArgs = null;
}
s.tag___110699 = (203);
s.tmp_1 = r0 = s.arg2;
r0 = (s.arg2 << 0);
s.tmp_2 = r0;
r0 = (s.tmp_1 == s.tmp_2);
s.tmp_0 = r0;
r0 = pxsim_numops_toBool(s.tmp_0);
if (!r0) { step = 1; continue; }
r0 = s.tmp_0;
{ step = 2; continue; }
case 1:
s.tmp_3 = r0 = s.arg2;
r0 = (s.arg2 >>> 0);
s.tmp_4 = r0;
r0 = (s.tmp_3 == s.tmp_4);
case 2:
// jmp value (already in r0)
s.tmp_5 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_5);
if (!r0) { step = 19; continue; }
r0 = (-31 <= s.arg2);
s.tmp_6 = r0;
r0 = pxsim_numops_toBool(s.tmp_6);
if (r0) { step = 3; continue; }
r0 = s.tmp_6;
{ step = 4; continue; }
case 3:
r0 = (s.arg2 <= 127);
case 4:
// jmp value (already in r0)
s.tmp_7 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_7);
if (!r0) { step = 7; continue; }
r0 = pxsim_numops_toBoolDecr(s.arg0);
if (!r0) { step = 5; continue; }
r0 = pxsim.BufferMethods.setByte(s.arg0, s.arg1, s.arg2);
case 5:
case 6:
r0 = 1;
{ step = 23; continue; }
{ step = 18; continue; }
case 7:
r0 = (0 <= s.arg2);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 12; continue; }
r0 = (s.arg2 <= 255);
s.tmp_1 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_1);
if (!r0) { step = 8; continue; }
s.tag___110699 = (204);
{ step = 11; continue; }
case 8:
r0 = (s.arg2 <= 65535);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 9; continue; }
s.tag___110699 = (205);
{ step = 10; continue; }
case 9:
s.tag___110699 = (206);
case 10:
case 11:
{ step = 17; continue; }
case 12:
r0 = (-127 <= s.arg2);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 13; continue; }
s.tag___110699 = (208);
{ step = 16; continue; }
case 13:
r0 = (-32767 <= s.arg2);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 14; continue; }
s.tag___110699 = (209);
{ step = 15; continue; }
case 14:
s.tag___110699 = (210);
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
s.tmp_0 = msgpack_tagFormat__P110134_mk(s);
s.tmp_0.arg0 = s.tag___110699;
s.callLocIdx = 1; s.pc = 24; return s.tmp_0;
case 24:
r0 = s.retval;
s.fmt___110742 = (r0);
r0 = pxsim_numops_toBoolDecr(s.arg0);
if (!r0) { step = 21; continue; }
r0 = pxsim.BufferMethods.setByte(s.arg0, s.arg1, s.tag___110699);
s.tmp_0 = r0 = s.arg0;
s.tmp_1 = r0 = s.fmt___110742;
r0 = (s.arg1 + 1);
s.tmp_2 = r0;
r0 = pxsim.BufferMethods.setNumber(s.tmp_0, s.tmp_1, s.tmp_2, s.arg2);
case 21:
case 22:
s.tmp_1 = pins_sizeOf__P110127_mk(s);
s.tmp_1.arg0 = s.fmt___110742;
s.callLocIdx = 2; s.pc = 25; return s.tmp_1;
case 25:
r0 = s.retval;
s.tmp_0 = r0;
r0 = (s.tmp_0 + 1);
case 23:
return leave(s, r0)
default: oops()
} } }
msgpack_packNumberCore__P110135.info = {"start":1632,"length":951,"line":56,"column":4,"endLine":86,"endColumn":5,"fileName":"pxt_modules/base/buffer.ts","functionName":"packNumberCore","argumentNames":["buf","offset","num"]}
function msgpack_packNumberCore__P110135_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: msgpack_packNumberCore__P110135, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
tmp_1: undefined,
tmp_2: undefined,
tmp_3: undefined,
tmp_4: undefined,
tmp_5: undefined,
tmp_6: undefined,
tmp_7: undefined,
tag___110699: undefined,
fmt___110742: undefined,
arg0: undefined,
arg1: undefined,
arg2: undefined,
} }
function pins_sizeOf__P110127(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.lambdaArgs = null;
}
s.tmp_0 = Buffer_sizeOfNumberFormat__P110163_mk(s);
s.tmp_0.arg0 = s.arg0;
s.callLocIdx = 0; s.pc = 1; return s.tmp_0;
case 1:
r0 = s.retval;
return leave(s, r0)
default: oops()
} } }
pins_sizeOf__P110127.info = {"start":42,"length":101,"line":2,"column":4,"endLine":4,"endColumn":5,"fileName":"pxt_modules/base/buffer.ts","functionName":"sizeOf","argumentNames":["format"]}
function pins_sizeOf__P110127_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: pins_sizeOf__P110127, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
arg0: undefined,
} }
function Buffer_sizeOfNumberFormat__P110163(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.lambdaArgs = null;
}
s.tmp_0 = r0 = s.arg0;
r0 = pxsim_pxtcore.switch_eq(1, s.tmp_0);
if (r0) { step = 1; continue; }
r0 = pxsim_pxtcore.switch_eq(2, s.tmp_0);
if (r0) { step = 2; continue; }
r0 = pxsim_pxtcore.switch_eq(6, s.tmp_0);
if (r0) { step = 3; continue; }
r0 = pxsim_pxtcore.switch_eq(7, s.tmp_0);
if (r0) { step = 4; continue; }
r0 = pxsim_pxtcore.switch_eq(3, s.tmp_0);
if (r0) { step = 5; continue; }
r0 = pxsim_pxtcore.switch_eq(4, s.tmp_0);
if (r0) { step = 6; continue; }
r0 = pxsim_pxtcore.switch_eq(8, s.tmp_0);
if (r0) { step = 7; continue; }
r0 = pxsim_pxtcore.switch_eq(9, s.tmp_0);
if (r0) { step = 8; continue; }
r0 = pxsim_pxtcore.switch_eq(5, s.tmp_0);
if (r0) { step = 9; continue; }
r0 = pxsim_pxtcore.switch_eq(10, s.tmp_0);
if (r0) { step = 10; continue; }
r0 = pxsim_pxtcore.switch_eq(12, s.tmp_0);
if (r0) { step = 11; continue; }
r0 = pxsim_pxtcore.switch_eq(11, s.tmp_0);
if (r0) { step = 12; continue; }
r0 = pxsim_pxtcore.switch_eq(15, s.tmp_0);
if (r0) { step = 13; continue; }
r0 = pxsim_pxtcore.switch_eq(13, s.tmp_0);
if (r0) { step = 14; continue; }
r0 = pxsim_pxtcore.switch_eq(16, s.tmp_0);
if (r0) { step = 15; continue; }
r0 = pxsim_pxtcore.switch_eq(14, s.tmp_0);
if (r0) { step = 16; continue; }
r0 = s.tmp_0;
{ step = 17; continue; }
case 1:
case 2:
case 3:
case 4:
r0 = 1;
{ step = 18; continue; }
case 5:
case 6:
case 7:
case 8:
r0 = 2;
{ step = 18; continue; }
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
r0 = 4;
{ step = 18; continue; }
case 15:
case 16:
r0 = 8;
{ step = 18; continue; }
case 17:
r0 = 0;
case 18:
return leave(s, r0)
default: oops()
} } }
Buffer_sizeOfNumberFormat__P110163.info = {"start":14912,"length":856,"line":508,"column":4,"endLine":532,"endColumn":5,"fileName":"pxt_modules/base/buffer.ts","functionName":"sizeOfNumberFormat","argumentNames":["format"]}
function Buffer_sizeOfNumberFormat__P110163_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: Buffer_sizeOfNumberFormat__P110163, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
arg0: undefined,
} }
function msgpack_tagFormat__P110134(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.lambdaArgs = null;
}
s.tmp_0 = r0 = s.arg0;
r0 = pxsim_pxtcore.switch_eq(203, s.tmp_0);
if (r0) { step = 1; continue; }
r0 = pxsim_pxtcore.switch_eq(204, s.tmp_0);
if (r0) { step = 2; continue; }
r0 = pxsim_pxtcore.switch_eq(205, s.tmp_0);
if (r0) { step = 3; continue; }
r0 = pxsim_pxtcore.switch_eq(206, s.tmp_0);
if (r0) { step = 4; continue; }
r0 = pxsim_pxtcore.switch_eq(208, s.tmp_0);
if (r0) { step = 5; continue; }
r0 = pxsim_pxtcore.switch_eq(209, s.tmp_0);
if (r0) { step = 6; continue; }
r0 = pxsim_pxtcore.switch_eq(210, s.tmp_0);
if (r0) { step = 7; continue; }
r0 = s.tmp_0;
{ step = 8; continue; }
case 1:
r0 = 16;
{ step = 9; continue; }
case 2:
r0 = 7;
{ step = 9; continue; }
case 3:
r0 = 9;
{ step = 9; continue; }
case 4:
r0 = 12;
{ step = 9; continue; }
case 5:
r0 = 6;
{ step = 9; continue; }
case 6:
r0 = 8;
{ step = 9; continue; }
case 7:
r0 = 10;
{ step = 9; continue; }
case 8:
r0 = null;
{ step = 9; continue; }
r0 = undefined;
case 9:
return leave(s, r0)
default: oops()
} } }
msgpack_tagFormat__P110134.info = {"start":1145,"length":481,"line":42,"column":4,"endLine":54,"endColumn":5,"fileName":"pxt_modules/base/buffer.ts","functionName":"tagFormat","argumentNames":["tag"]}
function msgpack_tagFormat__P110134_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: msgpack_tagFormat__P110134, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
arg0: undefined,
} }
function settings_runNumber__P110443(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
s.tmp_1 = settings_readNumber__P110456_mk(s);
s.tmp_1.arg0 = globals.RUN_KEY___110432;
s.callLocIdx = 7; s.pc = 3; return s.tmp_1;
case 3:
r0 = s.retval;
s.tmp_0 = r0;
r0 = pxsim_numops_toBool(s.tmp_0);
if (!r0) { step = 1; continue; }
r0 = s.tmp_0;
{ step = 2; continue; }
case 1:
r0 = 0;
case 2:
// jmp value (already in r0)
s.tmp_2 = r0;
r0 = s.tmp_2;
return leave(s, r0)
default: oops()
} } }
settings_runNumber__P110443.info = {"start":745,"length":75,"line":27,"column":4,"endLine":29,"endColumn":5,"fileName":"pxt_modules/settings/settings.ts","functionName":"runNumber","argumentNames":[]}
function settings_runNumber__P110443_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: settings_runNumber__P110443, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
tmp_1: undefined,
tmp_2: undefined,
} }
function settings_readNumber__P110456(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
s.buf___110818 = undefined;
s.nums___110825 = undefined;
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.lambdaArgs = null;
}
r0 = pxsim.settings._get(s.arg0);
s.buf___110818 = (r0);
r0 = pxsim_numops_toBoolDecr(s.buf___110818);
s.tmp_1 = r0;
r0 = pxsim_Boolean__bang(s.tmp_1);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 1; continue; }
r0 = undefined;
{ step = 7; continue; }
{ step = 6; continue; }
case 1:
s.tmp_2 = msgpack_unpackNumberArray__P110136_mk(s);
s.tmp_2.arg0 = s.buf___110818;
s.tmp_2.arg1 = 0;
s.callLocIdx = 19; s.pc = 8; return s.tmp_2;
case 8:
r0 = s.retval;
s.nums___110825 = (r0);
s.tmp_0 = r0 = s.nums___110825;
r0 = pxsim_numops_toBool(s.tmp_0);
if (r0) { step = 2; continue; }
r0 = s.tmp_0;
{ step = 3; continue; }
case 2:
r0 = pxsim_Array__length(s.nums___110825);
s.tmp_1 = r0;
r0 = (s.tmp_1 >= 1);
case 3:
// jmp value (already in r0)
s.tmp_2 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_2);
if (!r0) { step = 4; continue; }
r0 = pxsim_Array__getAt(s.nums___110825, 0);
{ step = 7; continue; }
case 4:
case 5:
r0 = undefined;
{ step = 7; continue; }
case 6:
r0 = undefined;
case 7:
return leave(s, r0)
default: oops()
} } }
settings_readNumber__P110456.info = {"start":3283,"length":313,"line":131,"column":4,"endLine":141,"endColumn":5,"fileName":"pxt_modules/settings/settings.ts","functionName":"readNumber","argumentNames":["key"]}
function settings_readNumber__P110456_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: settings_readNumber__P110456, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
tmp_1: undefined,
tmp_2: undefined,
buf___110818: undefined,
nums___110825: undefined,
arg0: undefined,
} }
function msgpack_unpackNumberArray__P110136(s) {
let r0 = s.r0, step = s.pc;
s.pc = -1;
while (true) {
if (yieldSteps-- < 0 && maybeYield(s, step, r0) || runtime !== pxsim.runtime) return null;
switch (step) {
case 0:
s.res___110839 = undefined;
s.fmt___110847 = undefined;
s.v___110856 = undefined;
if (s.lambdaArgs) {
s.arg0 = (s.lambdaArgs[0]);
s.arg1 = (s.lambdaArgs[1]);
s.lambdaArgs = null;
}
r0 = pxsim_Array__mk();
s.res___110839 = (r0);
case 1:
s.tmp_1 = r0 = s.arg1;
r0 = pxsim.BufferMethods.length(s.arg0);
s.tmp_2 = r0;
r0 = (s.tmp_1 < s.tmp_2);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 10; continue; }
s.tmp_3 = r0 = s.arg1;
r0 = (s.tmp_3 + 1);
s.arg1 = (r0);
s.tmp_4 = msgpack_tagFormat__P110134_mk(s);
r0 = pxsim.BufferMethods.getByte(s.arg0, s.tmp_3);
s.tmp_4.arg0 = r0;
s.callLocIdx = 3; s.pc = 12; return s.tmp_4;
case 12:
r0 = s.retval;
s.fmt___110847 = (r0);
r0 = (s.fmt___110847 === null);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 6; continue; }
s.tmp_1 = r0 = s.arg0;
r0 = (s.arg1 - 1);
s.tmp_2 = r0;
r0 = pxsim.BufferMethods.getNumber(s.tmp_1, 6, s.tmp_2);
s.v___110856 = (r0);
r0 = (-31 <= s.v___110856);
s.tmp_0 = r0;
r0 = pxsim_numops_toBool(s.tmp_0);
if (r0) { step = 2; continue; }
r0 = s.tmp_0;
{ step = 3; continue; }
case 2:
r0 = (s.v___110856 <= 127);
case 3:
// jmp value (already in r0)
s.tmp_1 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_1);
if (!r0) { step = 4; continue; }
r0 = pxsim_Array__push(s.res___110839, s.v___110856);
{ step = 5; continue; }
case 4:
r0 = null;
{ step = 11; continue; }
case 5:
{ step = 7; continue; }
case 6:
s.tmp_0 = r0 = s.res___110839;
r0 = pxsim.BufferMethods.getNumber(s.arg0, s.fmt___110847, s.arg1);
s.tmp_1 = r0;
r0 = pxsim_Array__push(s.tmp_0, s.tmp_1);
s.tmp_0 = r0 = s.arg1;
s.tmp_2 = pins_sizeOf__P110127_mk(s);
s.tmp_2.arg0 = s.fmt___110847;
s.callLocIdx = 4; s.pc = 13; return s.tmp_2;
case 13:
r0 = s.retval;
s.tmp_1 = r0;
r0 = (s.tmp_0 + s.tmp_1);
s.arg1 = (r0);
case 7:
case 8:
r0 = pxsim.BufferMethods.getByte(s.arg0, s.arg1);
s.tmp_1 = r0;
r0 = (s.tmp_1 === 193);
s.tmp_0 = r0;
r0 = pxsim_numops_toBoolDecr(s.tmp_0);
if (!r0) { step = 9; continue; }
r0 = (s.arg1 + 1);
s.arg1 = (r0);
{ step = 8; continue; }
case 9:
{ step = 1; continue; }
case 10:
r0 = s.res___110839;
case 11:
return leave(s, r0)
default: oops()
} } }
msgpack_unpackNumberArray__P110136.info = {"start":2650,"length":669,"line":91,"column":4,"endLine":111,"endColumn":5,"fileName":"pxt_modules/base/buffer.ts","functionName":"unpackNumberArray","argumentNames":["buf","offset"]}
function msgpack_unpackNumberArray__P110136_mk(s) {
checkStack(s.depth);
return {
parent: s, fn: msgpack_unpackNumberArray__P110136, depth: s.depth + 1,
pc: 0, retval: undefined, r0: undefined, overwrittenPC: false, lambdaArgs: null,
tmp_0: undefined,
tmp_1: undefined,
tmp_2: undefined,
tmp_3: undefined,
tmp_4: undefined,
res___110839: undefined,
fmt___110847: undefined,
v___110856: undefined,
arg0: undefined,
arg1: undefined,
} }
const breakpoints = setupDebugger(1, [])
return _main___P109993
})