From 727fcc7875cf222a6b47f8aba8e113e822bf3b92 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Wed, 1 Feb 2017 15:59:50 -0500 Subject: [PATCH] Lint for eslint-config-scratch@3 --- src/blocks/scratch3_control.js | 2 +- src/blocks/scratch3_data.js | 2 +- src/blocks/scratch3_event.js | 2 +- src/blocks/scratch3_looks.js | 2 +- src/blocks/scratch3_motion.js | 2 +- src/blocks/scratch3_operators.js | 2 +- src/blocks/scratch3_pen.js | 2 +- src/blocks/scratch3_procedures.js | 2 +- src/blocks/scratch3_sensing.js | 2 +- src/blocks/scratch3_sound.js | 2 +- src/engine/adapter.js | 10 +++++----- src/engine/blocks.js | 18 +++++++++--------- src/engine/execute.js | 2 +- src/engine/mutation-adapter.js | 8 ++++---- src/engine/runtime.js | 8 ++++---- src/engine/sequencer.js | 4 ++-- src/engine/thread.js | 6 +++--- src/engine/variable.js | 2 +- src/import/sb2import.js | 20 ++++++++++---------- src/sprites/rendered-target.js | 20 ++++++++++---------- src/util/cast.js | 2 +- src/virtual-machine.js | 10 +++++----- 22 files changed, 65 insertions(+), 65 deletions(-) diff --git a/src/blocks/scratch3_control.js b/src/blocks/scratch3_control.js index cbfe61a24..28737b361 100644 --- a/src/blocks/scratch3_control.js +++ b/src/blocks/scratch3_control.js @@ -11,7 +11,7 @@ var Scratch3ControlBlocks = function (runtime) { /** * Retrieve the block primitives implemented by this package. - * @return {Object.} Mapping of opcode to Function. + * @return {object.} Mapping of opcode to Function. */ Scratch3ControlBlocks.prototype.getPrimitives = function () { return { diff --git a/src/blocks/scratch3_data.js b/src/blocks/scratch3_data.js index 55a6b8bb7..b17835638 100644 --- a/src/blocks/scratch3_data.js +++ b/src/blocks/scratch3_data.js @@ -10,7 +10,7 @@ var Scratch3DataBlocks = function (runtime) { /** * Retrieve the block primitives implemented by this package. - * @return {Object.} Mapping of opcode to Function. + * @return {object.} Mapping of opcode to Function. */ Scratch3DataBlocks.prototype.getPrimitives = function () { return { diff --git a/src/blocks/scratch3_event.js b/src/blocks/scratch3_event.js index 8bfef42c2..b4c40116e 100644 --- a/src/blocks/scratch3_event.js +++ b/src/blocks/scratch3_event.js @@ -10,7 +10,7 @@ var Scratch3EventBlocks = function (runtime) { /** * Retrieve the block primitives implemented by this package. - * @return {Object.} Mapping of opcode to Function. + * @return {object.} Mapping of opcode to Function. */ Scratch3EventBlocks.prototype.getPrimitives = function () { return { diff --git a/src/blocks/scratch3_looks.js b/src/blocks/scratch3_looks.js index 60d95fd50..c7a9fcadf 100644 --- a/src/blocks/scratch3_looks.js +++ b/src/blocks/scratch3_looks.js @@ -10,7 +10,7 @@ var Scratch3LooksBlocks = function (runtime) { /** * Retrieve the block primitives implemented by this package. - * @return {Object.} Mapping of opcode to Function. + * @return {object.} Mapping of opcode to Function. */ Scratch3LooksBlocks.prototype.getPrimitives = function () { return { diff --git a/src/blocks/scratch3_motion.js b/src/blocks/scratch3_motion.js index be96e9cd8..857644dd5 100644 --- a/src/blocks/scratch3_motion.js +++ b/src/blocks/scratch3_motion.js @@ -12,7 +12,7 @@ var Scratch3MotionBlocks = function (runtime) { /** * Retrieve the block primitives implemented by this package. - * @return {Object.} Mapping of opcode to Function. + * @return {object.} Mapping of opcode to Function. */ Scratch3MotionBlocks.prototype.getPrimitives = function () { return { diff --git a/src/blocks/scratch3_operators.js b/src/blocks/scratch3_operators.js index d51e30894..fce7fb3a7 100644 --- a/src/blocks/scratch3_operators.js +++ b/src/blocks/scratch3_operators.js @@ -11,7 +11,7 @@ var Scratch3OperatorsBlocks = function (runtime) { /** * Retrieve the block primitives implemented by this package. - * @return {Object.} Mapping of opcode to Function. + * @return {object.} Mapping of opcode to Function. */ Scratch3OperatorsBlocks.prototype.getPrimitives = function () { return { diff --git a/src/blocks/scratch3_pen.js b/src/blocks/scratch3_pen.js index 6ef00cf71..c8f98341e 100644 --- a/src/blocks/scratch3_pen.js +++ b/src/blocks/scratch3_pen.js @@ -163,7 +163,7 @@ Scratch3PenBlocks.prototype._wrapHueOrShade = function (value) { /** * Retrieve the block primitives implemented by this package. - * @return {Object.} Mapping of opcode to Function. + * @return {object.} Mapping of opcode to Function. */ Scratch3PenBlocks.prototype.getPrimitives = function () { return { diff --git a/src/blocks/scratch3_procedures.js b/src/blocks/scratch3_procedures.js index 62c7b8dbe..471205f48 100644 --- a/src/blocks/scratch3_procedures.js +++ b/src/blocks/scratch3_procedures.js @@ -8,7 +8,7 @@ var Scratch3ProcedureBlocks = function (runtime) { /** * Retrieve the block primitives implemented by this package. - * @return {Object.} Mapping of opcode to Function. + * @return {object.} Mapping of opcode to Function. */ Scratch3ProcedureBlocks.prototype.getPrimitives = function () { return { diff --git a/src/blocks/scratch3_sensing.js b/src/blocks/scratch3_sensing.js index c940c5068..1601fc650 100644 --- a/src/blocks/scratch3_sensing.js +++ b/src/blocks/scratch3_sensing.js @@ -10,7 +10,7 @@ var Scratch3SensingBlocks = function (runtime) { /** * Retrieve the block primitives implemented by this package. - * @return {Object.} Mapping of opcode to Function. + * @return {object.} Mapping of opcode to Function. */ Scratch3SensingBlocks.prototype.getPrimitives = function () { return { diff --git a/src/blocks/scratch3_sound.js b/src/blocks/scratch3_sound.js index f1a16f179..7e1e466a0 100644 --- a/src/blocks/scratch3_sound.js +++ b/src/blocks/scratch3_sound.js @@ -11,7 +11,7 @@ var Scratch3SoundBlocks = function (runtime) { /** * Retrieve the block primitives implemented by this package. - * @return {Object.} Mapping of opcode to Function. + * @return {object.} Mapping of opcode to Function. */ Scratch3SoundBlocks.prototype.getPrimitives = function () { return { diff --git a/src/engine/adapter.js b/src/engine/adapter.js index e68cd3ea5..56275e1cb 100644 --- a/src/engine/adapter.js +++ b/src/engine/adapter.js @@ -6,7 +6,7 @@ var html = require('htmlparser2'); * to a usable form for the Scratch runtime. * This structure is based on Blockly xml.js:`domToWorkspace` and `domToBlock`. * @param {Element} blocksDOM DOM tree for this event. - * @return {Array.} Usable list of blocks from this CREATE event. + * @return {Array.} Usable list of blocks from this CREATE event. */ var domToBlocks = function (blocksDOM) { // At this level, there could be multiple blocks adjacent in the DOM tree. @@ -32,8 +32,8 @@ var domToBlocks = function (blocksDOM) { /** * Adapter between block creation events and block representation which can be * used by the Scratch runtime. - * @param {Object} e `Blockly.events.create` - * @return {Array.} List of blocks from this CREATE event. + * @param {object} e `Blockly.events.create` + * @return {Array.} List of blocks from this CREATE event. */ var adapter = function (e) { // Validate input @@ -47,8 +47,8 @@ var adapter = function (e) { * Convert and an individual block DOM to the representation tree. * Based on Blockly's `domToBlockHeadless_`. * @param {Element} blockDOM DOM tree for an individual block. - * @param {Object} blocks Collection of blocks to add to. - * @param {Boolean} isTopBlock Whether blocks at this level are "top blocks." + * @param {object} blocks Collection of blocks to add to. + * @param {boolean} isTopBlock Whether blocks at this level are "top blocks." * @param {?string} parent Parent block ID. * @return {undefined} */ diff --git a/src/engine/blocks.js b/src/engine/blocks.js index d2215a2cc..ed03be324 100644 --- a/src/engine/blocks.js +++ b/src/engine/blocks.js @@ -34,7 +34,7 @@ Blocks.BRANCH_INPUT_PREFIX = 'SUBSTACK'; /** * Provide an object with metadata for the requested block ID. * @param {!string} blockId ID of block we have stored. - * @return {?Object} Metadata about the block, if it exists. + * @return {?object} Metadata about the block, if it exists. */ Blocks.prototype.getBlock = function (blockId) { return this._blocks[blockId]; @@ -92,7 +92,7 @@ Blocks.prototype.getOpcode = function (id) { /** * Get all fields and their values for a block. * @param {?string} id ID of block to query. - * @return {!Object} All fields and their values. + * @return {!object} All fields and their values. */ Blocks.prototype.getFields = function (id) { var block = this._blocks[id]; @@ -102,7 +102,7 @@ Blocks.prototype.getFields = function (id) { /** * Get all non-branch inputs for a block. * @param {?string} id ID of block to query. - * @return {!Object} All non-branch inputs and their associated blocks. + * @return {!object} All non-branch inputs and their associated blocks. */ Blocks.prototype.getInputs = function (id) { var block = this._blocks[id]; @@ -121,7 +121,7 @@ Blocks.prototype.getInputs = function (id) { /** * Get mutation data for a block. * @param {?string} id ID of block to query. - * @return {!Object} Mutation for the block. + * @return {!object} Mutation for the block. */ Blocks.prototype.getMutation = function (id) { var block = this._blocks[id]; @@ -247,7 +247,7 @@ Blocks.prototype.blocklyListen = function (e, optRuntime) { /** * Block management: create blocks and scripts from a `create` event - * @param {!Object} block Blockly create event to be processed + * @param {!object} block Blockly create event to be processed */ Blocks.prototype.createBlock = function (block) { // Does the block already exist? @@ -267,7 +267,7 @@ Blocks.prototype.createBlock = function (block) { /** * Block management: change block field values - * @param {!Object} args Blockly change event to be processed + * @param {!object} args Blockly change event to be processed */ Blocks.prototype.changeBlock = function (args) { // Validate @@ -286,7 +286,7 @@ Blocks.prototype.changeBlock = function (args) { /** * Block management: move blocks from parent to parent - * @param {!Object} e Blockly move event to be processed + * @param {!object} e Blockly move event to be processed */ Blocks.prototype.moveBlock = function (e) { if (!this._blocks.hasOwnProperty(e.id)) { @@ -342,7 +342,7 @@ Blocks.prototype.moveBlock = function (e) { /** * Block management: delete blocks and their associated scripts. - * @param {!Object} e Blockly delete event to be processed. + * @param {!object} e Blockly delete event to be processed. */ Blocks.prototype.deleteBlock = function (e) { // @todo In runtime, stop threads running on this script. @@ -449,7 +449,7 @@ Blocks.prototype.blockToXML = function (blockId) { /** * Recursively encode a mutation object to XML. - * @param {!Object} mutation Object representing a mutation. + * @param {!object} mutation Object representing a mutation. * @return {string} XML string representing a mutation. */ Blocks.prototype.mutationToXML = function (mutation) { diff --git a/src/engine/execute.js b/src/engine/execute.js index a8967eb1f..44951aba3 100644 --- a/src/engine/execute.js +++ b/src/engine/execute.js @@ -4,7 +4,7 @@ var Thread = require('./thread'); /** * Utility function to determine if a value is a Promise. * @param {*} value Value to check for a Promise. - * @return {Boolean} True if the value appears to be a Promise. + * @return {boolean} True if the value appears to be a Promise. */ var isPromise = function (value) { return value && value.then && typeof value.then === 'function'; diff --git a/src/engine/mutation-adapter.js b/src/engine/mutation-adapter.js index 9277cc150..54bf7b4ee 100644 --- a/src/engine/mutation-adapter.js +++ b/src/engine/mutation-adapter.js @@ -2,8 +2,8 @@ var html = require('htmlparser2'); /** * Convert a part of a mutation DOM to a mutation VM object, recursively. - * @param {Object} dom DOM object for mutation tag. - * @return {Object} Object representing useful parts of this mutation. + * @param {object} dom DOM object for mutation tag. + * @return {object} Object representing useful parts of this mutation. */ var mutatorTagToObject = function (dom) { var obj = Object.create(null); @@ -24,8 +24,8 @@ var mutatorTagToObject = function (dom) { /** * Adapter between mutator XML or DOM and block representation which can be * used by the Scratch runtime. - * @param {(Object|string)} mutation Mutation XML string or DOM. - * @return {Object} Object representing the mutation. + * @param {(object|string)} mutation Mutation XML string or DOM. + * @return {object} Object representing the mutation. */ var mutationAdpater = function (mutation) { var mutationParsed; diff --git a/src/engine/runtime.js b/src/engine/runtime.js index 3a1967baa..f196a6a69 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -276,7 +276,7 @@ Runtime.prototype.getOpcodeFunction = function (opcode) { /** * Return whether an opcode represents a hat block. * @param {!string} opcode The opcode to look up. - * @return {Boolean} True if the op is known to be a hat. + * @return {boolean} True if the op is known to be a hat. */ Runtime.prototype.getIsHat = function (opcode) { return this._hats.hasOwnProperty(opcode); @@ -285,7 +285,7 @@ Runtime.prototype.getIsHat = function (opcode) { /** * Return whether an opcode represents an edge-activated hat block. * @param {!string} opcode The opcode to look up. - * @return {Boolean} True if the op is known to be a edge-activated hat. + * @return {boolean} True if the op is known to be a edge-activated hat. */ Runtime.prototype.getIsEdgeActivatedHat = function (opcode) { return this._hats.hasOwnProperty(opcode) && @@ -379,7 +379,7 @@ Runtime.prototype._restartThread = function (thread) { /** * Return whether a thread is currently active/running. * @param {?Thread} thread Thread object to check. - * @return {Boolean} True if the thread is active/running. + * @return {boolean} True if the thread is active/running. */ Runtime.prototype.isActiveThread = function (thread) { return this.threads.indexOf(thread) > -1; @@ -427,7 +427,7 @@ Runtime.prototype.allScriptsDo = function (f, optTarget) { /** * Start all relevant hats. * @param {!string} requestedHatOpcode Opcode of hats to start. - * @param {Object=} optMatchFields Optionally, fields to match on the hat. + * @param {object=} optMatchFields Optionally, fields to match on the hat. * @param {Target=} optTarget Optionally, a target to restrict to. * @return {Array.} List of threads started by this function. */ diff --git a/src/engine/sequencer.js b/src/engine/sequencer.js index 79476ba6f..06deb38f9 100644 --- a/src/engine/sequencer.js +++ b/src/engine/sequencer.js @@ -171,8 +171,8 @@ Sequencer.prototype.stepThread = function (thread) { /** * Step a thread into a block's branch. * @param {!Thread} thread Thread object to step to branch. - * @param {Number} branchNum Which branch to step to (i.e., 1, 2). - * @param {Boolean} isLoop Whether this block is a loop. + * @param {number} branchNum Which branch to step to (i.e., 1, 2). + * @param {boolean} isLoop Whether this block is a loop. */ Sequencer.prototype.stepToBranch = function (thread, branchNum, isLoop) { if (!branchNum) { diff --git a/src/engine/thread.js b/src/engine/thread.js index 8bef97496..9693b26f1 100644 --- a/src/engine/thread.js +++ b/src/engine/thread.js @@ -151,7 +151,7 @@ Thread.prototype.peekStack = function () { /** * Get top stack frame. - * @return {?Object} Last stack frame stored on this thread. + * @return {?object} Last stack frame stored on this thread. */ Thread.prototype.peekStackFrame = function () { return this.stackFrames.length > 0 ? this.stackFrames[this.stackFrames.length - 1] : null; @@ -159,7 +159,7 @@ Thread.prototype.peekStackFrame = function () { /** * Get stack frame above the current top. - * @return {?Object} Second to last stack frame stored on this thread. + * @return {?object} Second to last stack frame stored on this thread. */ Thread.prototype.peekParentStackFrame = function () { return this.stackFrames.length > 1 ? this.stackFrames[this.stackFrames.length - 2] : null; @@ -205,7 +205,7 @@ Thread.prototype.getParam = function (paramName) { /** * Whether the current execution of a thread is at the top of the stack. - * @return {Boolean} True if execution is at top of the stack. + * @return {boolean} True if execution is at top of the stack. */ Thread.prototype.atStackTop = function () { return this.peekStack() === this.topBlock; diff --git a/src/engine/variable.js b/src/engine/variable.js index 65fc21c45..3f2dcc5de 100644 --- a/src/engine/variable.js +++ b/src/engine/variable.js @@ -5,7 +5,7 @@ /** * @param {!string} name Name of the variable. - * @param {(string|Number)} value Value of the variable. + * @param {(string|number)} value Value of the variable. * @param {boolean} isCloud Whether the variable is stored in the cloud. * @constructor */ diff --git a/src/import/sb2import.js b/src/import/sb2import.js index 13983d569..40c17e309 100644 --- a/src/import/sb2import.js +++ b/src/import/sb2import.js @@ -17,7 +17,7 @@ var List = require('../engine/list'); /** * Parse a single "Scratch object" and create all its in-memory VM objects. - * @param {!Object} object From-JSON "Scratch object:" sprite, stage, watcher. + * @param {!object} object From-JSON "Scratch object:" sprite, stage, watcher. * @param {!Runtime} runtime Runtime object to load all structures into. * @param {boolean} topLevel Whether this is the top-level object (stage). * @return {?Target} Target created (stage or sprite). @@ -138,7 +138,7 @@ var parseScratchObject = function (object, runtime, topLevel) { * and process the top-level object (the stage object). * @param {!string} json SB2-format JSON to load. * @param {!Runtime} runtime Runtime object to load all structures into. - * @param {Boolean=} optForceSprite If set, treat as sprite (Sprite2). + * @param {boolean=} optForceSprite If set, treat as sprite (Sprite2). * @return {?Target} Top-level target created (stage or sprite). */ var sb2import = function (json, runtime, optForceSprite) { @@ -152,7 +152,7 @@ var sb2import = function (json, runtime, optForceSprite) { /** * Parse a Scratch object's scripts into VM blocks. * This should only handle top-level scripts that include X, Y coordinates. - * @param {!Object} scripts Scripts object from SB2 JSON. + * @param {!object} scripts Scripts object from SB2 JSON. * @param {!Blocks} blocks Blocks object to load parsed blocks into. */ var parseScripts = function (scripts, blocks) { @@ -184,8 +184,8 @@ var parseScripts = function (scripts, blocks) { * Could be used to parse a top-level script, * a list of blocks in a branch (e.g., in forever), * or a list of blocks in an argument (e.g., move [pick random...]). - * @param {Array.} blockList SB2 JSON-format block list. - * @return {Array.} Scratch VM-format block list. + * @param {Array.} blockList SB2 JSON-format block list. + * @return {Array.} Scratch VM-format block list. */ var parseBlockList = function (blockList) { var resultingList = []; @@ -207,8 +207,8 @@ var parseBlockList = function (blockList) { /** * Flatten a block tree into a block list. * Children are temporarily stored on the `block.children` property. - * @param {Array.} blocks list generated by `parseBlockList`. - * @return {Array.} Flattened list to be passed to `blocks.createBlock`. + * @param {Array.} blocks list generated by `parseBlockList`. + * @return {Array.} Flattened list to be passed to `blocks.createBlock`. */ var flatten = function (blocks) { var finalBlocks = []; @@ -228,7 +228,7 @@ var flatten = function (blocks) { * into an argument map. This allows us to provide the expected inputs * to a mutated procedure call. * @param {string} procCode Scratch 2.0 procedure string. - * @return {Object} Argument map compatible with those in sb2specmap. + * @return {object} Argument map compatible with those in sb2specmap. */ var parseProcedureArgMap = function (procCode) { var argMap = [ @@ -259,8 +259,8 @@ var parseProcedureArgMap = function (procCode) { /** * Parse a single SB2 JSON-formatted block and its children. - * @param {!Object} sb2block SB2 JSON-formatted block. - * @return {Object} Scratch VM format block. + * @param {!object} sb2block SB2 JSON-formatted block. + * @return {object} Scratch VM format block. */ var parseBlock = function (sb2block) { // First item in block object is the old opcode (e.g., 'forward:'). diff --git a/src/sprites/rendered-target.js b/src/sprites/rendered-target.js index 9eb8956b2..b82afa846 100644 --- a/src/sprites/rendered-target.js +++ b/src/sprites/rendered-target.js @@ -184,7 +184,7 @@ RenderedTarget.prototype.setXY = function (x, y) { /** * Get the rendered direction and scale, after applying rotation style. - * @return {Object} Direction and scale to render. + * @return {object} Direction and scale to render. */ RenderedTarget.prototype._getRenderedDirectionAndScale = function () { // Default: no changes to `this.direction` or `this.scale`. @@ -480,7 +480,7 @@ RenderedTarget.prototype.isSprite = function () { /** * Return the rendered target's tight bounding box. * Includes top, left, bottom, right attributes in Scratch coordinates. - * @return {?Object} Tight bounding box, or null. + * @return {?object} Tight bounding box, or null. */ RenderedTarget.prototype.getBounds = function () { if (this.renderer) { @@ -493,7 +493,7 @@ RenderedTarget.prototype.getBounds = function () { * Return whether touching a point. * @param {number} x X coordinate of test point. * @param {number} y Y coordinate of test point. - * @return {Boolean} True iff the rendered target is touching the point. + * @return {boolean} True iff the rendered target is touching the point. */ RenderedTarget.prototype.isTouchingPoint = function (x, y) { if (this.renderer) { @@ -513,7 +513,7 @@ RenderedTarget.prototype.isTouchingPoint = function (x, y) { /** * Return whether touching a stage edge. - * @return {Boolean} True iff the rendered target is touching the stage edge. + * @return {boolean} True iff the rendered target is touching the stage edge. */ RenderedTarget.prototype.isTouchingEdge = function () { if (this.renderer) { @@ -533,7 +533,7 @@ RenderedTarget.prototype.isTouchingEdge = function () { /** * Return whether touching any of a named sprite's clones. * @param {string} spriteName Name of the sprite. - * @return {Boolean} True iff touching a clone of the sprite. + * @return {boolean} True iff touching a clone of the sprite. */ RenderedTarget.prototype.isTouchingSprite = function (spriteName) { var firstClone = this.runtime.getSpriteTargetByName(spriteName); @@ -550,7 +550,7 @@ RenderedTarget.prototype.isTouchingSprite = function (spriteName) { /** * Return whether touching a color. * @param {Array.} rgb [r,g,b], values between 0-255. - * @return {Promise.} True iff the rendered target is touching the color. + * @return {Promise.} True iff the rendered target is touching the color. */ RenderedTarget.prototype.isTouchingColor = function (rgb) { if (this.renderer) { @@ -561,9 +561,9 @@ RenderedTarget.prototype.isTouchingColor = function (rgb) { /** * Return whether rendered target's color is touching a color. - * @param {Object} targetRgb {Array.} [r,g,b], values between 0-255. - * @param {Object} maskRgb {Array.} [r,g,b], values between 0-255. - * @return {Promise.} True iff the color is touching the color. + * @param {object} targetRgb {Array.} [r,g,b], values between 0-255. + * @param {object} maskRgb {Array.} [r,g,b], values between 0-255. + * @return {Promise.} True iff the color is touching the color. */ RenderedTarget.prototype.colorIsTouchingColor = function (targetRgb, maskRgb) { if (this.renderer) { @@ -611,7 +611,7 @@ RenderedTarget.prototype.goBehindOther = function (other) { * Keep a desired position within a fence. * @param {number} newX New desired X position. * @param {number} newY New desired Y position. - * @param {Object=} optFence Optional fence with left, right, top bottom. + * @param {object=} optFence Optional fence with left, right, top bottom. * @return {Array.} Fenced X and Y coordinates. */ RenderedTarget.prototype.keepInFence = function (newX, newY, optFence) { diff --git a/src/util/cast.js b/src/util/cast.js index 0723b5ecd..a8a1535b8 100644 --- a/src/util/cast.js +++ b/src/util/cast.js @@ -95,7 +95,7 @@ Cast.toRgbColorObject = function (value) { * In Scratch 2.0, this is captured by `interp.compare.` * @param {*} v1 First value to compare. * @param {*} v2 Second value to compare. - * @returns {Number} Negative number if v1 < v2; 0 if equal; positive otherwise. + * @returns {number} Negative number if v1 < v2; 0 if equal; positive otherwise. */ Cast.compare = function (v1, v2) { var n1 = Number(v1); diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 8e9b4a940..003c80e9f 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -75,7 +75,7 @@ VirtualMachine.prototype.greenFlag = function () { /** * Set whether the VM is in "turbo mode." * When true, loops don't yield to redraw. - * @param {Boolean} turboModeOn Whether turbo mode should be set. + * @param {boolean} turboModeOn Whether turbo mode should be set. */ VirtualMachine.prototype.setTurboMode = function (turboModeOn) { this.runtime.turboMode = !!turboModeOn; @@ -84,7 +84,7 @@ VirtualMachine.prototype.setTurboMode = function (turboModeOn) { /** * Set whether the VM is in 2.0 "compatibility mode." * When true, ticks go at 2.0 speed (30 TPS). - * @param {Boolean} compatibilityModeOn Whether compatibility mode is set. + * @param {boolean} compatibilityModeOn Whether compatibility mode is set. */ VirtualMachine.prototype.setCompatibilityMode = function (compatibilityModeOn) { this.runtime.setCompatibilityMode(!!compatibilityModeOn); @@ -129,7 +129,7 @@ VirtualMachine.prototype.getPlaygroundData = function () { /** * Post I/O data to the virtual devices. * @param {?string} device Name of virtual I/O device. - * @param {Object} data Any data object to post to the I/O device. + * @param {object} data Any data object to post to the I/O device. */ VirtualMachine.prototype.postIOData = function (device, data) { if (this.runtime.ioDevices[device]) { @@ -168,7 +168,7 @@ VirtualMachine.prototype.addSprite2 = function (json) { /** * Add a costume to the current editing target. - * @param {!Object} costumeObject Object representing the costume. + * @param {!object} costumeObject Object representing the costume. */ VirtualMachine.prototype.addCostume = function (costumeObject) { this.editingTarget.sprite.costumes.push(costumeObject); @@ -180,7 +180,7 @@ VirtualMachine.prototype.addCostume = function (costumeObject) { /** * Add a backdrop to the stage. - * @param {!Object} backdropObject Object representing the backdrop. + * @param {!object} backdropObject Object representing the backdrop. */ VirtualMachine.prototype.addBackdrop = function (backdropObject) { var stage = this.runtime.getTargetForStage();