This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
forked from scratchfoundation/scratch-blocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
javascript_compressed.js
38 lines (36 loc) · 20.8 KB
/
javascript_compressed.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Do not edit this file; automatically generated by build.py.
'use strict';
Blockly.JavaScript=new Blockly.Generator("JavaScript");Blockly.JavaScript.addReservedWords("Blockly,break,case,catch,continue,debugger,default,delete,do,else,finally,for,function,if,in,instanceof,new,return,switch,this,throw,try,typeof,var,void,while,with,class,enum,export,extends,import,super,implements,interface,let,package,private,protected,public,static,yield,const,null,true,false,Array,ArrayBuffer,Boolean,Date,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Error,eval,EvalError,Float32Array,Float64Array,Function,Infinity,Int16Array,Int32Array,Int8Array,isFinite,isNaN,Iterator,JSON,Math,NaN,Number,Object,parseFloat,parseInt,RangeError,ReferenceError,RegExp,StopIteration,String,SyntaxError,TypeError,Uint16Array,Uint32Array,Uint8Array,Uint8ClampedArray,undefined,uneval,URIError,applicationCache,closed,Components,content,_content,controllers,crypto,defaultStatus,dialogArguments,directories,document,frameElement,frames,fullScreen,globalStorage,history,innerHeight,innerWidth,length,location,locationbar,localStorage,menubar,messageManager,mozAnimationStartTime,mozInnerScreenX,mozInnerScreenY,mozPaintCount,name,navigator,opener,outerHeight,outerWidth,pageXOffset,pageYOffset,parent,performance,personalbar,pkcs11,returnValue,screen,screenX,screenY,scrollbars,scrollMaxX,scrollMaxY,scrollX,scrollY,self,sessionStorage,sidebar,status,statusbar,toolbar,top,URL,window,addEventListener,alert,atob,back,blur,btoa,captureEvents,clearImmediate,clearInterval,clearTimeout,close,confirm,disableExternalCapture,dispatchEvent,dump,enableExternalCapture,escape,find,focus,forward,GeckoActiveXObject,getAttention,getAttentionWithCycleCount,getComputedStyle,getSelection,home,matchMedia,maximize,minimize,moveBy,moveTo,mozRequestAnimationFrame,open,openDialog,postMessage,print,prompt,QueryInterface,releaseEvents,removeEventListener,resizeBy,resizeTo,restore,routeEvent,scroll,scrollBy,scrollByLines,scrollByPages,scrollTo,setCursor,setImmediate,setInterval,setResizable,setTimeout,showModalDialog,sizeToContent,stop,unescape,updateCommands,XPCNativeWrapper,XPCSafeJSObjectWrapper,onabort,onbeforeunload,onblur,onchange,onclick,onclose,oncontextmenu,ondevicemotion,ondeviceorientation,ondragdrop,onerror,onfocus,onhashchange,onkeydown,onkeypress,onkeyup,onload,onmousedown,onmousemove,onmouseout,onmouseover,onmouseup,onmozbeforepaint,onpaint,onpopstate,onreset,onresize,onscroll,onselect,onsubmit,onunload,onpageshow,onpagehide,Image,Option,Worker,Event,Range,File,FileReader,Blob,BlobBuilder,Attr,CDATASection,CharacterData,Comment,console,DocumentFragment,DocumentType,DomConfiguration,DOMError,DOMErrorHandler,DOMException,DOMImplementation,DOMImplementationList,DOMImplementationRegistry,DOMImplementationSource,DOMLocator,DOMObject,DOMString,DOMStringList,DOMTimeStamp,DOMUserData,Entity,EntityReference,MediaQueryList,MediaQueryListListener,NameList,NamedNodeMap,Node,NodeFilter,NodeIterator,NodeList,Notation,Plugin,PluginArray,ProcessingInstruction,SharedWorker,Text,TimeRanges,Treewalker,TypeInfo,UserDataHandler,Worker,WorkerGlobalScope,HTMLDocument,HTMLElement,HTMLAnchorElement,HTMLAppletElement,HTMLAudioElement,HTMLAreaElement,HTMLBaseElement,HTMLBaseFontElement,HTMLBodyElement,HTMLBRElement,HTMLButtonElement,HTMLCanvasElement,HTMLDirectoryElement,HTMLDivElement,HTMLDListElement,HTMLEmbedElement,HTMLFieldSetElement,HTMLFontElement,HTMLFormElement,HTMLFrameElement,HTMLFrameSetElement,HTMLHeadElement,HTMLHeadingElement,HTMLHtmlElement,HTMLHRElement,HTMLIFrameElement,HTMLImageElement,HTMLInputElement,HTMLKeygenElement,HTMLLabelElement,HTMLLIElement,HTMLLinkElement,HTMLMapElement,HTMLMenuElement,HTMLMetaElement,HTMLModElement,HTMLObjectElement,HTMLOListElement,HTMLOptGroupElement,HTMLOptionElement,HTMLOutputElement,HTMLParagraphElement,HTMLParamElement,HTMLPreElement,HTMLQuoteElement,HTMLScriptElement,HTMLSelectElement,HTMLSourceElement,HTMLSpanElement,HTMLStyleElement,HTMLTableElement,HTMLTableCaptionElement,HTMLTableCellElement,HTMLTableDataCellElement,HTMLTableHeaderCellElement,HTMLTableColElement,HTMLTableRowElement,HTMLTableSectionElement,HTMLTextAreaElement,HTMLTimeElement,HTMLTitleElement,HTMLTrackElement,HTMLUListElement,HTMLUnknownElement,HTMLVideoElement,HTMLCanvasElement,CanvasRenderingContext2D,CanvasGradient,CanvasPattern,TextMetrics,ImageData,CanvasPixelArray,HTMLAudioElement,HTMLVideoElement,NotifyAudioAvailableEvent,HTMLCollection,HTMLAllCollection,HTMLFormControlsCollection,HTMLOptionsCollection,HTMLPropertiesCollection,DOMTokenList,DOMSettableTokenList,DOMStringMap,RadioNodeList,SVGDocument,SVGElement,SVGAElement,SVGAltGlyphElement,SVGAltGlyphDefElement,SVGAltGlyphItemElement,SVGAnimationElement,SVGAnimateElement,SVGAnimateColorElement,SVGAnimateMotionElement,SVGAnimateTransformElement,SVGSetElement,SVGCircleElement,SVGClipPathElement,SVGColorProfileElement,SVGCursorElement,SVGDefsElement,SVGDescElement,SVGEllipseElement,SVGFilterElement,SVGFilterPrimitiveStandardAttributes,SVGFEBlendElement,SVGFEColorMatrixElement,SVGFEComponentTransferElement,SVGFECompositeElement,SVGFEConvolveMatrixElement,SVGFEDiffuseLightingElement,SVGFEDisplacementMapElement,SVGFEDistantLightElement,SVGFEFloodElement,SVGFEGaussianBlurElement,SVGFEImageElement,SVGFEMergeElement,SVGFEMergeNodeElement,SVGFEMorphologyElement,SVGFEOffsetElement,SVGFEPointLightElement,SVGFESpecularLightingElement,SVGFESpotLightElement,SVGFETileElement,SVGFETurbulenceElement,SVGComponentTransferFunctionElement,SVGFEFuncRElement,SVGFEFuncGElement,SVGFEFuncBElement,SVGFEFuncAElement,SVGFontElement,SVGFontFaceElement,SVGFontFaceFormatElement,SVGFontFaceNameElement,SVGFontFaceSrcElement,SVGFontFaceUriElement,SVGForeignObjectElement,SVGGElement,SVGGlyphElement,SVGGlyphRefElement,SVGGradientElement,SVGLinearGradientElement,SVGRadialGradientElement,SVGHKernElement,SVGImageElement,SVGLineElement,SVGMarkerElement,SVGMaskElement,SVGMetadataElement,SVGMissingGlyphElement,SVGMPathElement,SVGPathElement,SVGPatternElement,SVGPolylineElement,SVGPolygonElement,SVGRectElement,SVGScriptElement,SVGStopElement,SVGStyleElement,SVGSVGElement,SVGSwitchElement,SVGSymbolElement,SVGTextElement,SVGTextPathElement,SVGTitleElement,SVGTRefElement,SVGTSpanElement,SVGUseElement,SVGViewElement,SVGVKernElement,SVGAngle,SVGColor,SVGICCColor,SVGElementInstance,SVGElementInstanceList,SVGLength,SVGLengthList,SVGMatrix,SVGNumber,SVGNumberList,SVGPaint,SVGPoint,SVGPointList,SVGPreserveAspectRatio,SVGRect,SVGStringList,SVGTransform,SVGTransformList,SVGAnimatedAngle,SVGAnimatedBoolean,SVGAnimatedEnumeration,SVGAnimatedInteger,SVGAnimatedLength,SVGAnimatedLengthList,SVGAnimatedNumber,SVGAnimatedNumberList,SVGAnimatedPreserveAspectRatio,SVGAnimatedRect,SVGAnimatedString,SVGAnimatedTransformList,SVGPathSegList,SVGPathSeg,SVGPathSegArcAbs,SVGPathSegArcRel,SVGPathSegClosePath,SVGPathSegCurvetoCubicAbs,SVGPathSegCurvetoCubicRel,SVGPathSegCurvetoCubicSmoothAbs,SVGPathSegCurvetoCubicSmoothRel,SVGPathSegCurvetoQuadraticAbs,SVGPathSegCurvetoQuadraticRel,SVGPathSegCurvetoQuadraticSmoothAbs,SVGPathSegCurvetoQuadraticSmoothRel,SVGPathSegLinetoAbs,SVGPathSegLinetoHorizontalAbs,SVGPathSegLinetoHorizontalRel,SVGPathSegLinetoRel,SVGPathSegLinetoVerticalAbs,SVGPathSegLinetoVerticalRel,SVGPathSegMovetoAbs,SVGPathSegMovetoRel,ElementTimeControl,TimeEvent,SVGAnimatedPathData,SVGAnimatedPoints,SVGColorProfileRule,SVGCSSRule,SVGExternalResourcesRequired,SVGFitToViewBox,SVGLangSpace,SVGLocatable,SVGRenderingIntent,SVGStylable,SVGTests,SVGTextContentElement,SVGTextPositioningElement,SVGTransformable,SVGUnitTypes,SVGURIReference,SVGViewSpec,SVGZoomAndPan");
Blockly.JavaScript.ORDER_ATOMIC=0;Blockly.JavaScript.ORDER_NEW=1.1;Blockly.JavaScript.ORDER_MEMBER=1.2;Blockly.JavaScript.ORDER_FUNCTION_CALL=2;Blockly.JavaScript.ORDER_INCREMENT=3;Blockly.JavaScript.ORDER_DECREMENT=3;Blockly.JavaScript.ORDER_BITWISE_NOT=4.1;Blockly.JavaScript.ORDER_UNARY_PLUS=4.2;Blockly.JavaScript.ORDER_UNARY_NEGATION=4.3;Blockly.JavaScript.ORDER_LOGICAL_NOT=4.4;Blockly.JavaScript.ORDER_TYPEOF=4.5;Blockly.JavaScript.ORDER_VOID=4.6;Blockly.JavaScript.ORDER_DELETE=4.7;
Blockly.JavaScript.ORDER_DIVISION=5.1;Blockly.JavaScript.ORDER_MULTIPLICATION=5.2;Blockly.JavaScript.ORDER_MODULUS=5.3;Blockly.JavaScript.ORDER_SUBTRACTION=6.1;Blockly.JavaScript.ORDER_ADDITION=6.2;Blockly.JavaScript.ORDER_BITWISE_SHIFT=7;Blockly.JavaScript.ORDER_RELATIONAL=8;Blockly.JavaScript.ORDER_IN=8;Blockly.JavaScript.ORDER_INSTANCEOF=8;Blockly.JavaScript.ORDER_EQUALITY=9;Blockly.JavaScript.ORDER_BITWISE_AND=10;Blockly.JavaScript.ORDER_BITWISE_XOR=11;Blockly.JavaScript.ORDER_BITWISE_OR=12;
Blockly.JavaScript.ORDER_LOGICAL_AND=13;Blockly.JavaScript.ORDER_LOGICAL_OR=14;Blockly.JavaScript.ORDER_CONDITIONAL=15;Blockly.JavaScript.ORDER_ASSIGNMENT=16;Blockly.JavaScript.ORDER_COMMA=17;Blockly.JavaScript.ORDER_NONE=99;
Blockly.JavaScript.ORDER_OVERRIDES=[[Blockly.JavaScript.ORDER_FUNCTION_CALL,Blockly.JavaScript.ORDER_MEMBER],[Blockly.JavaScript.ORDER_FUNCTION_CALL,Blockly.JavaScript.ORDER_FUNCTION_CALL],[Blockly.JavaScript.ORDER_MEMBER,Blockly.JavaScript.ORDER_MEMBER],[Blockly.JavaScript.ORDER_MEMBER,Blockly.JavaScript.ORDER_FUNCTION_CALL],[Blockly.JavaScript.ORDER_LOGICAL_NOT,Blockly.JavaScript.ORDER_LOGICAL_NOT],[Blockly.JavaScript.ORDER_MULTIPLICATION,Blockly.JavaScript.ORDER_MULTIPLICATION],[Blockly.JavaScript.ORDER_ADDITION,
Blockly.JavaScript.ORDER_ADDITION],[Blockly.JavaScript.ORDER_LOGICAL_AND,Blockly.JavaScript.ORDER_LOGICAL_AND],[Blockly.JavaScript.ORDER_LOGICAL_OR,Blockly.JavaScript.ORDER_LOGICAL_OR]];
Blockly.JavaScript.init=function(a){Blockly.JavaScript.definitions_=Object.create(null);Blockly.JavaScript.functionNames_=Object.create(null);Blockly.JavaScript.variableDB_?Blockly.JavaScript.variableDB_.reset():Blockly.JavaScript.variableDB_=new Blockly.Names(Blockly.JavaScript.RESERVED_WORDS_);Blockly.JavaScript.variableDB_.setVariableMap(a.getVariableMap());for(var c=[],b=a.getAllVariables(),d=0;d<b.length;d++)c[d]=Blockly.JavaScript.variableDB_.getName(b[d].getId(),Blockly.Variables.NAME_TYPE);
a=Blockly.Variables.allDeveloperVariables(a);for(d=0;d<a.length;d++)c.push(Blockly.JavaScript.variableDB_.getName(a[d],Blockly.Names.DEVELOPER_VARIABLE_TYPE));c.length&&(Blockly.JavaScript.definitions_.variables="var "+c.join(", ")+";")};
Blockly.JavaScript.finish=function(a){var c=[],b;for(b in Blockly.JavaScript.definitions_)c.push(Blockly.JavaScript.definitions_[b]);delete Blockly.JavaScript.definitions_;delete Blockly.JavaScript.functionNames_;Blockly.JavaScript.variableDB_.reset();return c.join("\n\n")+"\n\n\n"+a};Blockly.JavaScript.scrubNakedValue=function(a){return a+";\n"};Blockly.JavaScript.quote_=function(a){a=a.replace(/\\/g,"\\\\").replace(/\n/g,"\\\n").replace(/'/g,"\\'");return"'"+a+"'"};
Blockly.JavaScript.scrub_=function(a,c){var b="";if(!a.outputConnection||!a.outputConnection.targetConnection){var d=a.getCommentText();(d=Blockly.utils.wrap(d,Blockly.JavaScript.COMMENT_WRAP-3))&&(b=a.getProcedureDef?b+("/**\n"+Blockly.JavaScript.prefixLines(d+"\n"," * ")+" */\n"):b+Blockly.JavaScript.prefixLines(d+"\n","// "));for(var e=0;e<a.inputList.length;e++)a.inputList[e].type==Blockly.INPUT_VALUE&&(d=a.inputList[e].connection.targetBlock())&&(d=Blockly.JavaScript.allNestedComments(d))&&(b+=
Blockly.JavaScript.prefixLines(d,"// "))}e=a.nextConnection&&a.nextConnection.targetBlock();e=Blockly.JavaScript.blockToCode(e);return b+c+e};
Blockly.JavaScript.getAdjusted=function(a,c,b,d,e){b=b||0;e=e||Blockly.JavaScript.ORDER_NONE;a.workspace.options.oneBasedIndex&&b--;var f=a.workspace.options.oneBasedIndex?"1":"0";a=0<b?Blockly.JavaScript.valueToCode(a,c,Blockly.JavaScript.ORDER_ADDITION)||f:0>b?Blockly.JavaScript.valueToCode(a,c,Blockly.JavaScript.ORDER_SUBTRACTION)||f:d?Blockly.JavaScript.valueToCode(a,c,Blockly.JavaScript.ORDER_UNARY_NEGATION)||f:Blockly.JavaScript.valueToCode(a,c,e)||f;if(Blockly.isNumber(a))a=parseFloat(a)+b,
d&&(a=-a);else{if(0<b){a=a+" + "+b;var g=Blockly.JavaScript.ORDER_ADDITION}else 0>b&&(a=a+" - "+-b,g=Blockly.JavaScript.ORDER_SUBTRACTION);d&&(a=b?"-("+a+")":"-"+a,g=Blockly.JavaScript.ORDER_UNARY_NEGATION);g=Math.floor(g);e=Math.floor(e);g&&e>=g&&(a="("+a+")")}return a};Blockly.JavaScript.colour={};Blockly.JavaScript.control={};Blockly.JavaScript.control_forever=function(a){var c=Blockly.JavaScript.statementToCode(a,"SUBSTACK");c=Blockly.JavaScript.addLoopTrap(c,a.id);Blockly.JavaScript.variableDB_.getDistinctName("count",Blockly.Variables.NAME_TYPE);return"while (true) {\n"+c+"}\n"};
Blockly.JavaScript.control_repeat=function(a){var c=Blockly.JavaScript.valueToCode(a,"TIMES",Blockly.JavaScript.ORDER_ASSIGNMENT)||"0",b=Blockly.JavaScript.statementToCode(a,"SUBSTACK");b=Blockly.JavaScript.addLoopTrap(b,a.id);a=Blockly.JavaScript.variableDB_.getDistinctName("count",Blockly.Variables.NAME_TYPE);return"for (var "+a+" = 0; "+a+" < "+c+"; "+a+"++) {\n"+b+"}\n"};
Blockly.JavaScript.control_repeat_until=function(a){var c=Blockly.JavaScript.valueToCode(a,"CONDITION",Blockly.JavaScript.ORDER_NONE)||"false",b=Blockly.JavaScript.statementToCode(a,"SUBSTACK");b=Blockly.JavaScript.addLoopTrap(b,a.id);return a=a="while ( ("+c+") == false) {\n"+b+"}\n"};Blockly.JavaScript.control_if=function(a){var c=Blockly.JavaScript.valueToCode(a,"CONDITION",Blockly.JavaScript.ORDER_NONE)||"false";a=Blockly.JavaScript.statementToCode(a,"SUBSTACK");return"if ("+c+") {\n"+a+"}\n"};
Blockly.JavaScript.control_if_else=function(a){var c=Blockly.JavaScript.valueToCode(a,"CONDITION",Blockly.JavaScript.ORDER_NONE)||"false",b=Blockly.JavaScript.statementToCode(a,"SUBSTACK");a=Blockly.JavaScript.statementToCode(a,"SUBSTACK2");return"if ("+c+") {\n"+b+"} else {\n"+a+"}\n"};
Blockly.JavaScript.event={};Blockly.JavaScript.event_whenflagclicked=function(a){return"flagClicked();\n"};Blockly.JavaScript.event_whenflagclicked_animate=function(a){return"flagClicked();\n{\n"+Blockly.JavaScript.statementToCode(a,"SUBSTACK")+"}\n"};Blockly.JavaScript.lists={};Blockly.JavaScript.looks={};Blockly.JavaScript.looks_say=function(a){a=Blockly.JavaScript.valueToCode(a,"MESSAGE",Blockly.JavaScript.ORDER_ASSIGNMENT)||"0";Blockly.JavaScript.variableDB_.getDistinctName("message",Blockly.Variables.NAME_TYPE);return"alert("+a+");\n"};Blockly.JavaScript.math={};Blockly.JavaScript.math_number=function(a){return[parseFloat(a.getFieldValue("NUM")),Blockly.JavaScript.ORDER_ATOMIC]};Blockly.JavaScript.math_integer=Blockly.JavaScript.math_number;Blockly.JavaScript.math_whole_number=Blockly.JavaScript.math_number;Blockly.JavaScript.math_positive_number=Blockly.JavaScript.math_number;Blockly.JavaScript.math_angle=Blockly.JavaScript.math_number;Blockly.JavaScript.motion={};Blockly.JavaScript.operators={};Blockly.JavaScript.operator_add=function(a){var c=Blockly.JavaScript.valueToCode(a,"NUM1",Blockly.JavaScript.ORDER_ADDITION)||"0";a=Blockly.JavaScript.valueToCode(a,"NUM2",Blockly.JavaScript.ORDER_ADDITION)||"0";return[""+c+" + "+a,Blockly.JavaScript.ORDER_ADDITION]};
Blockly.JavaScript.operator_subtract=function(a){var c=Blockly.JavaScript.valueToCode(a,"NUM1",Blockly.JavaScript.ORDER_SUBTRACTION)||"0";a=Blockly.JavaScript.valueToCode(a,"NUM2",Blockly.JavaScript.ORDER_SUBTRACTION)||"0";return[""+c+" - "+a,Blockly.JavaScript.ORDER_SUBTRACTION]};
Blockly.JavaScript.operator_multiply=function(a){var c=Blockly.JavaScript.valueToCode(a,"NUM1",Blockly.JavaScript.ORDER_MULTIPLICATION)||"0";a=Blockly.JavaScript.valueToCode(a,"NUM2",Blockly.JavaScript.ORDER_MULTIPLICATION)||"0";return[""+c+" * "+a,Blockly.JavaScript.ORDER_MULTIPLICATION]};
Blockly.JavaScript.operator_divide=function(a){var c=Blockly.JavaScript.valueToCode(a,"NUM1",Blockly.JavaScript.ORDER_DIVISION)||"0";a=Blockly.JavaScript.valueToCode(a,"NUM2",Blockly.JavaScript.ORDER_DIVISION)||"0";return[""+c+" / "+a,Blockly.JavaScript.ORDER_DIVISION]};
Blockly.JavaScript.operator_divide=function(a){var c=Blockly.JavaScript.valueToCode(a,"NUM1",Blockly.JavaScript.ORDER_DIVISION)||"0";a=Blockly.JavaScript.valueToCode(a,"NUM2",Blockly.JavaScript.ORDER_DIVISION)||"0";return[""+c+" / "+a,Blockly.JavaScript.ORDER_DIVISION]};
Blockly.JavaScript.operator_lt=function(a){var c=Blockly.JavaScript.valueToCode(a,"OPERAND1",Blockly.JavaScript.ORDER_RELATIONAL)||"0";a=Blockly.JavaScript.valueToCode(a,"OPERAND2",Blockly.JavaScript.ORDER_RELATIONAL)||"0";var b=Number(c.substring(1,c.length-1)),d=Number(a.substring(1,a.length-1));if(isNaN(b)||isNaN(d))b=c,d=a;return[""+b+" < "+d,Blockly.JavaScript.ORDER_RELATIONAL]};
Blockly.JavaScript.operator_equals=function(a){var c=Blockly.JavaScript.valueToCode(a,"OPERAND1",Blockly.JavaScript.ORDER_EQUALITY)||"0";a=Blockly.JavaScript.valueToCode(a,"OPERAND2",Blockly.JavaScript.ORDER_EQUALITY)||"0";var b=Number(c.substring(1,c.length-1)),d=Number(a.substring(1,a.length-1));if(isNaN(b)||isNaN(d))b=c,d=a;return[""+b+" == "+d,Blockly.JavaScript.ORDER_EQUALITY]};
Blockly.JavaScript.operator_gt=function(a){var c=Blockly.JavaScript.valueToCode(a,"OPERAND1",Blockly.JavaScript.ORDER_RELATIONAL)||"0";a=Blockly.JavaScript.valueToCode(a,"OPERAND2",Blockly.JavaScript.ORDER_RELATIONAL)||"0";var b=Number(c.substring(1,c.length-1)),d=Number(a.substring(1,a.length-1));if(isNaN(b)||isNaN(d))b=c,d=a;return[""+b+" > "+d,Blockly.JavaScript.ORDER_RELATIONAL]};
Blockly.JavaScript.operator_and=function(a){var c=Blockly.JavaScript.valueToCode(a,"OPERAND1",Blockly.JavaScript.ORDER_LOGICAL_AND)||"false";a=Blockly.JavaScript.valueToCode(a,"OPERAND2",Blockly.JavaScript.ORDER_LOGICAL_AND)||"false";return[""+c+" && "+a,Blockly.JavaScript.ORDER_LOGICAL_AND]};
Blockly.JavaScript.operator_or=function(a){var c=Blockly.JavaScript.valueToCode(a,"OPERAND1",Blockly.JavaScript.ORDER_LOGICAL_OR)||"false";a=Blockly.JavaScript.valueToCode(a,"OPERAND2",Blockly.JavaScript.ORDER_LOGICAL_OR)||"false";return[""+c+" || "+a,Blockly.JavaScript.ORDER_LOGICAL_OR]};Blockly.JavaScript.procedures={};
Blockly.JavaScript.procedures_defreturn=function(a){var c=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),b=Blockly.JavaScript.statementToCode(a,"STACK");Blockly.JavaScript.STATEMENT_PREFIX&&(b=Blockly.JavaScript.prefixLines(Blockly.JavaScript.STATEMENT_PREFIX.replace(/%1/g,"'"+a.id+"'"),Blockly.JavaScript.INDENT)+b);Blockly.JavaScript.INFINITE_LOOP_TRAP&&(b=Blockly.JavaScript.INFINITE_LOOP_TRAP.replace(/%1/g,"'"+a.id+"'")+b);var d=Blockly.JavaScript.valueToCode(a,
"RETURN",Blockly.JavaScript.ORDER_NONE)||"";d&&(d=" return "+d+";\n");for(var e=[],f=0;f<a.arguments_.length;f++)e[f]=Blockly.JavaScript.variableDB_.getName(a.arguments_[f],Blockly.Variables.NAME_TYPE);b="function "+c+"("+e.join(", ")+") {\n"+b+d+"}";b=Blockly.JavaScript.scrub_(a,b);Blockly.JavaScript.definitions_[c]=b;return null};Blockly.JavaScript.procedures_defnoreturn=Blockly.JavaScript.procedures_defreturn;
Blockly.JavaScript.procedures_callreturn=function(a){for(var c=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),b=[],d=0;d<a.arguments_.length;d++)b[d]=Blockly.JavaScript.valueToCode(a,"ARG"+d,Blockly.JavaScript.ORDER_COMMA)||"null";return[c+"("+b.join(", ")+")",Blockly.JavaScript.ORDER_FUNCTION_CALL]};
Blockly.JavaScript.procedures_callnoreturn=function(a){for(var c=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("NAME"),Blockly.Procedures.NAME_TYPE),b=[],d=0;d<a.arguments_.length;d++)b[d]=Blockly.JavaScript.valueToCode(a,"ARG"+d,Blockly.JavaScript.ORDER_COMMA)||"null";return c+"("+b.join(", ")+");\n"};
Blockly.JavaScript.procedures_ifreturn=function(a){var c="if ("+(Blockly.JavaScript.valueToCode(a,"CONDITION",Blockly.JavaScript.ORDER_NONE)||"false")+") {\n";a.hasReturnValue_?(a=Blockly.JavaScript.valueToCode(a,"VALUE",Blockly.JavaScript.ORDER_NONE)||"null",c+=" return "+a+";\n"):c+=" return;\n";return c+"}\n"};Blockly.JavaScript.texts={};Blockly.JavaScript.text=function(a){return[Blockly.JavaScript.quote_(a.getFieldValue("TEXT")),Blockly.JavaScript.ORDER_ATOMIC]};Blockly.JavaScript.variables={};Blockly.JavaScript.data_variablemenu=function(a){return[Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VARIABLE"),Blockly.Variables.NAME_TYPE),Blockly.JavaScript.ORDER_ATOMIC]};Blockly.JavaScript.data_variable=function(a){return[Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VARIABLE"),Blockly.Variables.NAME_TYPE),Blockly.JavaScript.ORDER_ATOMIC]};
Blockly.JavaScript.data_setvariableto=function(a){var c=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VARIABLE"),Blockly.Variables.NAME_TYPE);a=Blockly.JavaScript.valueToCode(a,"VALUE",Blockly.JavaScript.ORDER_ASSIGNMENT)||"0";var b=a.substring(1,a.length-1);isNaN(b)&&(b=a);return c+" = "+b+";\n"};
Blockly.JavaScript.data_changevariableby=function(a){var c=Blockly.JavaScript.variableDB_.getName(a.getFieldValue("VARIABLE"),Blockly.Variables.NAME_TYPE);a=Blockly.JavaScript.valueToCode(a,"VALUE",Blockly.JavaScript.ORDER_ASSIGNMENT)||"0";var b=a.substring(1,a.length-1);isNaN(b)&&(b=a);return c+" += "+b+";\n"};Blockly.JavaScript.data_showvariable=function(a){return"// TODO: Show variable: "+Blockly.JavaScript.valueToCode(a,"VARIABLE",Blockly.JavaScript.ORDER_NONE)+"\n"};
Blockly.JavaScript.data_hidevariable=function(a){return"// TODO: Hide variable: "+Blockly.JavaScript.valueToCode(a,"VARIABLE",Blockly.JavaScript.ORDER_NONE)+"\n"};