diff --git a/src/blocks/scratch3_control.js b/src/blocks/scratch3_control.js index ebf1951514e..c5dd04728e9 100644 --- a/src/blocks/scratch3_control.js +++ b/src/blocks/scratch3_control.js @@ -193,7 +193,7 @@ class Scratch3ControlBlocks { } allAtOnce (args, util) { - // Since the "all at once" block is implemented for compatiblity with + // Since the "all at once" block is implemented for compatibility with // Scratch 2.0 projects, it behaves the same way it did in 2.0, which // is to simply run the contained script (like "if 1 = 1"). // (In early versions of Scratch 2.0, it would work the same way as diff --git a/src/blocks/scratch3_data.js b/src/blocks/scratch3_data.js index 1290434b430..11cdc21ee5e 100644 --- a/src/blocks/scratch3_data.js +++ b/src/blocks/scratch3_data.js @@ -202,7 +202,7 @@ class Scratch3DataBlocks { // We don't bother using .indexOf() at all, because it would end up with // edge cases such as the index of '123' in [4, 7, 123, '123', 9]. // If we use indexOf(), this block would return 4 instead of 3, because - // indexOf() sees the first occurence of the string 123 as the fourth + // indexOf() sees the first occurrence of the string 123 as the fourth // item in the list. With Scratch, this would be confusing -- after all, // '123' and 123 look the same, so one would expect the block to say // that the first occurrence of '123' (or 123) to be the third item. diff --git a/src/compiler/enums.js b/src/compiler/enums.js index 1d493bf4884..a907243c943 100644 --- a/src/compiler/enums.js +++ b/src/compiler/enums.js @@ -10,7 +10,7 @@ * * At compile time, often we don't know exactly type a value will be but we can tell it must be one of a * set of types. For this reason, the number value of each type represents a possibility space, where set - * bits indicate that their corropoding type *could* be encountered at runtime. + * bits indicate that their corresponding type *could* be encountered at runtime. * For example, a type of InputType.NUMBER | InputType.STRING means the value will be either a number or * a string at runtime, the compiler can't tell which, but we do know that it's not a boolean or NaN as * those bits are not set. @@ -31,11 +31,11 @@ const InputType = { NUMBER_ZERO: 0x008, /** The value -0 */ NUMBER_NEG_ZERO: 0x010, - /** Any negitive integer excluding -0 */ + /** Any negative integer excluding -0 */ NUMBER_NEG_INT: 0x020, - /** Any negitive fractional number, excluding integers. */ + /** Any negative fractional number, excluding integers. */ NUMBER_NEG_FRACT: 0x040, - /** Any negitive number excluding -0 and -Infinity. Equal to NUMBER_NEG_INT | NUMBER_NEG_FRACT */ + /** Any negative number excluding -0 and -Infinity. Equal to NUMBER_NEG_INT | NUMBER_NEG_FRACT */ NUMBER_NEG_REAL: 0x060, /** The value -Infinity */ NUMBER_NEG_INF: 0x080, @@ -49,7 +49,7 @@ const InputType = { NUMBER_INF: 0x081, /** Any positive number, excluding 0. Equal to NUMBER_POS_REAL | NUMBER_POS_INF */ NUMBER_POS: 0x007, - /** Any negitive number, excluding -0. Equal to NUMBER_NEG_REAL | NUMBER_NEG_INF */ + /** Any negative number, excluding -0. Equal to NUMBER_NEG_REAL | NUMBER_NEG_INF */ NUMBER_NEG: 0x0E0, /** Any whole number. Equal to NUMBER_POS_INT | NUMBER_ZERO */ NUMBER_WHOLE: 0x00A, @@ -66,12 +66,12 @@ const InputType = { NUMBER: 0x0FF, /** Any number, including NaN. Equal to NUMBER | NUMBER_NAN */ NUMBER_OR_NAN: 0x1FF, - /** Anything that can be interperated as a number. Equal to NUMBER | STRING_NUM | BOOLEAN */ + /** Anything that can be interpreted as a number. Equal to NUMBER | STRING_NUM | BOOLEAN */ NUMBER_INTERPRETABLE: 0x12FF, - /** Any string which as a non-NaN neumeric interpretation, excluding ''. */ + /** Any string which as a non-NaN numeric interpretation, excluding ''. */ STRING_NUM: 0x200, - /** Any string which has no non-NaN neumeric interpretation, including ''. */ + /** Any string which has no non-NaN numeric interpretation, including ''. */ STRING_NAN: 0x400, /** Either of the strings 'true' or 'false'. */ STRING_BOOLEAN: 0x800, @@ -81,7 +81,7 @@ const InputType = { /** Any boolean. */ BOOLEAN: 0x1000, - /** Any input that can be interperated as a boolean. Equal to BOOLEAN | STRING_BOOLEAN */ + /** Any input that can be interpreted as a boolean. Equal to BOOLEAN | STRING_BOOLEAN */ BOOLEAN_INTERPRETABLE: 0x1800, /** Any value type (a type a scratch variable can hold). Equal to NUMBER_OR_NAN | STRING | BOOLEAN */ @@ -120,10 +120,10 @@ const StackOpcode = { CONTROL_WAIT: 'control.wait', CONTROL_WAIT_UNTIL: 'control.waitUntil', CONTROL_CLEAR_COUNTER: 'control.counterClear', - CONTORL_INCR_COUNTER: 'control.counterIncr', + CONTROL_INCR_COUNTER: 'control.counterIncr', LIST_ADD: 'list.add', - LIST_INSERT: 'list.instert', + LIST_INSERT: 'list.insert', LIST_REPLACE: 'list.replace', LIST_DELETE_ALL: 'list.deleteAll', LIST_DELETE: 'list.delete', diff --git a/src/compiler/irgen.js b/src/compiler/irgen.js index 08d1701fbb3..e7cb6226582 100644 --- a/src/compiler/irgen.js +++ b/src/compiler/irgen.js @@ -14,7 +14,7 @@ const { IntermediateScript, IntermediateRepresentation } = require('./intermediate'); -const oldCompilerCompatiblity = require('./old-compiler-compatibility.js'); +const oldCompilerCompatibility = require('./old-compiler-compatibility.js'); /** * @fileoverview Generate intermediate representations from Scratch blocks. @@ -99,8 +99,8 @@ class ScriptTreeGenerator { } this.oldCompilerStub = ( - oldCompilerCompatiblity.enabled ? - new oldCompilerCompatiblity.ScriptTreeGeneratorStub(this) : + oldCompilerCompatibility.enabled ? + new oldCompilerCompatibility.ScriptTreeGeneratorStub(this) : null ); } @@ -701,7 +701,7 @@ class ScriptTreeGenerator { case 'control_clear_counter': return new IntermediateStackBlock(StackOpcode.CONTROL_CLEAR_COUNTER); case 'control_incr_counter': - return new IntermediateStackBlock(StackOpcode.CONTORL_INCR_COUNTER); + return new IntermediateStackBlock(StackOpcode.CONTROL_INCR_COUNTER); case 'data_addtolist': return new IntermediateStackBlock(StackOpcode.LIST_ADD, { @@ -1363,7 +1363,7 @@ class ScriptTreeGenerator { if (this.thread.stackClick) { // We still need to treat the hat as a normal block (so executableHat should be false) for - // interpreter parity, but the reuslt is ignored. + // interpreter parity, but the result is ignored. const opcodeFunction = this.runtime.getOpcodeFunction(opcode); if (opcodeFunction) { return new IntermediateStack([ diff --git a/src/compiler/jsgen.js b/src/compiler/jsgen.js index ebbdc6bf4f5..d2ca329e602 100644 --- a/src/compiler/jsgen.js +++ b/src/compiler/jsgen.js @@ -662,7 +662,7 @@ class JSGenerator { case StackOpcode.CONTROL_CLEAR_COUNTER: this.source += 'runtime.ext_scratch3_control._counter = 0;\n'; break; - case StackOpcode.CONTORL_INCR_COUNTER: + case StackOpcode.CONTROL_INCR_COUNTER: this.source += 'runtime.ext_scratch3_control._counter++;\n'; break; diff --git a/src/engine/blocks.js b/src/engine/blocks.js index 68b3e606e7a..9e146618774 100644 --- a/src/engine/blocks.js +++ b/src/engine/blocks.js @@ -77,7 +77,7 @@ class Blocks { _monitored: null, /** - * A cache of hat opcodes to collection of theads to execute. + * A cache of hat opcodes to collection of threads to execute. * @type {object.} */ scripts: {}, diff --git a/src/engine/execute.js b/src/engine/execute.js index c9f2f115e06..14784f1e5b6 100644 --- a/src/engine/execute.js +++ b/src/engine/execute.js @@ -5,7 +5,7 @@ const Thread = require('./thread'); const cast = require('../util/cast'); /** - * Single BlockUtility instance reused by execute for every pritimive ran. + * Single BlockUtility instance reused by execute for every primitive ran. * @const */ const blockUtility = new BlockUtility(); @@ -258,7 +258,7 @@ class BlockCached { /** * An arguments object for block implementations. All executions of this - * specific block will use this objecct. + * specific block will use this object. * @type {object} */ this._argValues = { @@ -357,7 +357,7 @@ class BlockCached { // Cache all input children blocks in the operation lists. The // operations can later be run in the order they appear in correctly // executing the operations quickly in a flat loop instead of needing to - // recursivly iterate them. + // recursively iterate them. for (const inputName in this._inputs) { const input = this._inputs[inputName]; if (input.block) { diff --git a/src/engine/profiler.js b/src/engine/profiler.js index bfb47e61758..00e0657160c 100644 --- a/src/engine/profiler.js +++ b/src/engine/profiler.js @@ -101,7 +101,7 @@ class ProfilerFrame { /** * The depth of the recorded frame. This can help compare recursive - * funtions that are recorded. Each level of recursion with have a + * functions that are recorded. Each level of recursion with have a * different depth value. * @type {number} */ @@ -288,7 +288,7 @@ class Profiler { // Remove this frames totalTime from the parent's selfTime. stack[depth - 1].selfTime -= frame.totalTime; - // This frame occured once. + // This frame occurred once. frame.count = 1; this.onFrame(frame); diff --git a/src/engine/runtime.js b/src/engine/runtime.js index e017bcb30c4..8d6758d1d1e 100644 --- a/src/engine/runtime.js +++ b/src/engine/runtime.js @@ -111,7 +111,7 @@ const ArgumentTypeMap = (() => { }; map[ArgumentType.IMAGE] = { // Inline images are weird because they're not actually "arguments". - // They are more analagous to the label on a block. + // They are more analogous to the label on a block. fieldType: 'field_image' }; map[ArgumentType.COSTUME] = { @@ -344,7 +344,7 @@ class Runtime extends EventEmitter { */ this.currentStepTime = 1000 / 30; - // Set an intial value for this.currentMSecs + // Set an initial value for this.currentMSecs this.updateCurrentMSecs(); /** @@ -391,7 +391,7 @@ class Runtime extends EventEmitter { const newCloudDataManager = cloudDataManager(this.cloudOptions); /** - * Check wether the runtime has any cloud data. + * Check whether the runtime has any cloud data. * @type {function} * @return {boolean} Whether or not the runtime currently has any * cloud variables. @@ -1432,7 +1432,7 @@ class Runtime extends EventEmitter { break; } - // Allow extensiosn to override outputShape + // Allow extension to override outputShape if (blockInfo.blockShape) { blockJSON.outputShape = blockInfo.blockShape; } @@ -1582,7 +1582,7 @@ class Runtime extends EventEmitter { } /** - * Helper for _convertPlaceholdes which handles inline images which are a specialized case of block "arguments". + * Helper for _convertPlaceholders which handles inline images which are a specialized case of block "arguments". * @param {object} argInfo Metadata about the inline image as specified by the extension * @return {object} JSON blob for a scratch-blocks image field. * @private @@ -2339,7 +2339,7 @@ class Runtime extends EventEmitter { /** * Move a target in the execution order by a relative amount. * - * A positve number will make the target execute earlier. A negative number + * A positive number will make the target execute earlier. A negative number * will make the target execute later in the order. * * @param {Target} executableTarget target to move @@ -3388,7 +3388,7 @@ class Runtime extends EventEmitter { } /** - * @deprecated Used by old versions of TurboWarp. Superceded by upstream's quit() + * @deprecated Used by old versions of TurboWarp. Superseded by upstream's quit() */ stop () { this.quit(); diff --git a/src/engine/sequencer.js b/src/engine/sequencer.js index c374fb694b9..7daf2a609e6 100644 --- a/src/engine/sequencer.js +++ b/src/engine/sequencer.js @@ -71,7 +71,7 @@ class Sequencer { stepThreads () { // Work time is 75% of the thread stepping interval. const WORK_TIME = 0.75 * this.runtime.currentStepTime; - // For compatibility with Scatch 2, update the millisecond clock + // For compatibility with Scratch 2, update the millisecond clock // on the Runtime once per step (see Interpreter.as in Scratch 2 // for original use of `currentMSecs`) this.runtime.updateCurrentMSecs(); diff --git a/src/engine/target.js b/src/engine/target.js index 931ec3c1fc9..b9c7a789b5a 100644 --- a/src/engine/target.js +++ b/src/engine/target.js @@ -110,7 +110,7 @@ class Target extends EventEmitter { } /** - * Clear all edge-activaed hat values. + * Clear all edge-activated hat values. */ clearEdgeActivatedValues () { this._edgeActivatedHatValues = {}; @@ -776,7 +776,7 @@ class Target extends EventEmitter { // Handle global var conflicts with existing global vars (e.g. a sprite is uploaded, and has // blocks referencing some variable that the sprite does not own, and this // variable conflicts with a global var) - // In this case, we want to merge the new variable referenes with the + // In this case, we want to merge the new variable references with the // existing global variable for (const conflictId in conflictIdsToReplace) { const existingId = conflictIdsToReplace[conflictId]; @@ -786,7 +786,7 @@ class Target extends EventEmitter { // Handle global var conflicts existing local vars (e.g a sprite is uploaded, // and has blocks referencing some variable that the sprite does not own, and this - // variable conflcits with another sprite's local var). + // variable conflicts with another sprite's local var). // In this case, we want to go through the variable references and update // the name of the variable in that reference. for (const conflictId in conflictNamesToReplace) { diff --git a/src/extension-support/block-type.js b/src/extension-support/block-type.js index ecaf70754dc..5801d4a1753 100644 --- a/src/extension-support/block-type.js +++ b/src/extension-support/block-type.js @@ -14,7 +14,7 @@ const BlockType = { BUTTON: 'button', /** - * A text label (not an actual block) for adding comments or labling blocks + * A text label (not an actual block) for adding comments or labeling blocks */ LABEL: 'label', diff --git a/src/extensions/scratch3_ev3/index.js b/src/extensions/scratch3_ev3/index.js index 99255bc2bcf..6ad947aaf37 100644 --- a/src/extensions/scratch3_ev3/index.js +++ b/src/extensions/scratch3_ev3/index.js @@ -676,7 +676,7 @@ class EV3 { } /** - * Genrates direct commands that are sent to the EV3 as a single or compounded byte arrays. + * Generates direct commands that are sent to the EV3 as a single or compounded byte arrays. * See 'EV3 Communication Developer Kit', section 4, page 24 at * https://education.lego.com/en-us/support/mindstorms-ev3/developer-kits. * @@ -819,7 +819,7 @@ class EV3 { * Byte 0 – 1: Reply size, Little Endian. Reply size not including these 2 bytes * Byte 2 – 3: Message counter, Little Endian. Equals the Direct Command * Byte 4: Reply type. Either DIRECT_REPLY or DIRECT_REPLY_ERROR - * Byte 5 - n: Resonse buffer. I.e. the content of the by the Command reserved global variables. + * Byte 5 - n: Response buffer. I.e. the content of the by the Command reserved global variables. * I.e. if the command reserved 64 bytes, these bytes will be placed in the reply * packet as the bytes 5 to 68. * diff --git a/src/extensions/scratch3_gdx_for/index.js b/src/extensions/scratch3_gdx_for/index.js index 64bfae8f00a..342835668e2 100644 --- a/src/extensions/scratch3_gdx_for/index.js +++ b/src/extensions/scratch3_gdx_for/index.js @@ -834,7 +834,7 @@ class Scratch3GdxForBlocks { } // If the sensor is already facing up or down, reduce the threshold. - // This prevents small fluctations in acceleration while it is being + // This prevents small fluctuations in acceleration while it is being // turned from causing the hat block to trigger multiple times. let threshold = FACING_THRESHOLD; if (this._facingUp || this._facingDown) { diff --git a/src/extensions/scratch3_microbit/index.js b/src/extensions/scratch3_microbit/index.js index 1d1ddc3925b..b057df10551 100644 --- a/src/extensions/scratch3_microbit/index.js +++ b/src/extensions/scratch3_microbit/index.js @@ -57,7 +57,7 @@ const BLEUUID = { }; /** - * Manage communication with a MicroBit peripheral over a Scrath Link client socket. + * Manage communication with a MicroBit peripheral over a Scratch Link client socket. */ class MicroBit { diff --git a/src/extensions/scratch3_music/index.js b/src/extensions/scratch3_music/index.js index 5a4b226f4c5..445e9640963 100644 --- a/src/extensions/scratch3_music/index.js +++ b/src/extensions/scratch3_music/index.js @@ -1188,7 +1188,7 @@ class Scratch3MusicBlocks { } /** - * Calcuate the frequency ratio for a given musical interval. + * Calculate the frequency ratio for a given musical interval. * @param {number} interval - the pitch interval to convert. * @return {number} a ratio corresponding to the input interval. * @private diff --git a/src/extensions/scratch3_pen/index.js b/src/extensions/scratch3_pen/index.js index 496c7a5b2ac..43fd08bb84e 100644 --- a/src/extensions/scratch3_pen/index.js +++ b/src/extensions/scratch3_pen/index.js @@ -659,7 +659,7 @@ class Scratch3PenBlocks { /** * The "change pen {ColorParam} by {number}" block changes one of the pen's color parameters - * by a given amound. + * by a given amount. * @param {object} args - the block arguments. * @property {ColorParam} COLOR_PARAM - the name of the selected color parameter. * @property {number} VALUE - the amount to change the selected parameter by. @@ -672,7 +672,7 @@ class Scratch3PenBlocks { /** * The "set pen {ColorParam} to {number}" block sets one of the pen's color parameters - * to a given amound. + * to a given amount. * @param {object} args - the block arguments. * @property {ColorParam} COLOR_PARAM - the name of the selected color parameter. * @property {number} VALUE - the amount to set the selected parameter to. @@ -713,7 +713,7 @@ class Scratch3PenBlocks { /* LEGACY OPCODES */ /** - * Scratch 2 "hue" param is equivelant to twice the new "color" param. + * Scratch 2 "hue" param is equivalent to twice the new "color" param. * @param {object} args - the block arguments. * @property {number} HUE - the amount to set the hue to. * @param {object} util - utility object provided by the runtime. @@ -730,7 +730,7 @@ class Scratch3PenBlocks { } /** - * Scratch 2 "hue" param is equivelant to twice the new "color" param. + * Scratch 2 "hue" param is equivalent to twice the new "color" param. * @param {object} args - the block arguments. * @property {number} HUE - the amount of desired hue change. * @param {object} util - utility object provided by the runtime. diff --git a/src/extensions/scratch3_speech2text/index.js b/src/extensions/scratch3_speech2text/index.js index 79b5ac1e012..0d1a12266fd 100644 --- a/src/extensions/scratch3_speech2text/index.js +++ b/src/extensions/scratch3_speech2text/index.js @@ -87,7 +87,7 @@ class Scratch3Speech2TextBlocks { * The list of queued `resolve` callbacks for 'Listen and Wait' blocks. * We only listen to for one utterance at a time. We may encounter multiple * 'Listen and wait' blocks that tell us to start listening. If one starts - * and hasn't receieved results back yet, when we encounter more, any further ones + * and hasn't received results back yet, when we encounter more, any further ones * will all resolve when we get the next acceptable transcription result back. * @type {!Array} * @private @@ -119,7 +119,7 @@ class Scratch3Speech2TextBlocks { /** * The socket used to communicate with the speech server to send microphone data - * and recieve transcription results. + * and receive transcription results. * @type {WebSocket} * @private */ @@ -289,7 +289,7 @@ class Scratch3Speech2TextBlocks { } /** - * Decides whether to keep a given transcirption result. + * Decides whether to keep a given transcription result. * @param {number} fuzzyMatchIndex Index of the fuzzy match or -1 if there is no match. * @param {object} result The json object representing the transcription result. * @param {string} normalizedTranscript The transcription text used for matching (i.e. lowercased, no punctuation). @@ -336,7 +336,7 @@ class Scratch3Speech2TextBlocks { /** * Normalizes text a bit to facilitate matching. Lowercases, removes some punctuation and whitespace. - * @param {string} text The text to normalzie + * @param {string} text The text to normalize * @returns {string} The normalized text. * @private */ @@ -391,10 +391,10 @@ class Scratch3Speech2TextBlocks { } this._currentUtterance = transcriptionResult; - log.info(`Keeing result: ${this._currentUtterance}`); + log.info(`Keeping result: ${this._currentUtterance}`); this._utteranceForEdgeTrigger = transcriptionResult; - // We're done listening so resolove all the promises and reset everying so we're ready for next time. + // We're done listening so resolve all the promises and reset everything so we're ready for next time. this._resetListening(); // We got results so clear out the timeouts. @@ -504,7 +504,7 @@ class Scratch3Speech2TextBlocks { /** * Callback called when it is time to setup the new web socket. - * @param {Function} resolve - function to call when the web socket opens succesfully. + * @param {Function} resolve - function to call when the web socket opens successfully. * @param {Function} reject - function to call if opening the web socket fails. */ _newSocketCallback (resolve, reject) { @@ -691,7 +691,7 @@ class Scratch3Speech2TextBlocks { /** * Reporter for the last heard phrase/utterance. - * @return {string} The lastest thing we heard from a listen and wait block. + * @return {string} The latest thing we heard from a listen and wait block. */ getSpeech () { return this._currentUtterance; diff --git a/src/extensions/scratch3_translate/index.js b/src/extensions/scratch3_translate/index.js index 3fe4e022a0c..5dee7d791a6 100644 --- a/src/extensions/scratch3_translate/index.js +++ b/src/extensions/scratch3_translate/index.js @@ -139,7 +139,7 @@ class Scratch3TranslateBlocks { text: formatMessage({ id: 'translate.viewerLanguage', default: 'language', - description: 'the languge of the project viewer' + description: 'the language of the project viewer' }), blockType: BlockType.REPORTER, arguments: {} @@ -157,7 +157,7 @@ class Scratch3TranslateBlocks { /** * Computes a list of language code and name pairs for the given language. * @param {string} code The language code to get the list of language pairs - * @return {Array.>} An array of languge name and + * @return {Array.>} An array of language name and * language code pairs. * @private */ @@ -176,7 +176,7 @@ class Scratch3TranslateBlocks { const names = languageNames.menuMap[this._viewerLanguageCode]; let langNameObj = names.find(obj => obj.code === this._viewerLanguageCode); - // If we don't have a name entry yet, try looking it up via the Google langauge + // If we don't have a name entry yet, try looking it up via the Google language // code instead of Scratch's (e.g. for es-419 we look up es to get espanol) if (!langNameObj && languageNames.scratchToGoogleMap[this._viewerLanguageCode]) { const lookupCode = languageNames.scratchToGoogleMap[this._viewerLanguageCode]; diff --git a/src/extensions/scratch3_video_sensing/index.js b/src/extensions/scratch3_video_sensing/index.js index 3940043c06c..f7e9f583cce 100644 --- a/src/extensions/scratch3_video_sensing/index.js +++ b/src/extensions/scratch3_video_sensing/index.js @@ -45,7 +45,7 @@ const SensingSubject = { /** The sensor traits of the whole stage. */ STAGE: 'Stage', - /** The senosr traits of the area overlapped by this sprite. */ + /** The sensor traits of the area overlapped by this sprite. */ SPRITE: 'this sprite' }; @@ -79,7 +79,7 @@ class Scratch3VideoSensingBlocks { this.runtime = runtime; /** - * The motion detection algoritm used to power the motion amount and + * The motion detection algorithm used to power the motion amount and * direction values. * @type {VideoMotion} */ diff --git a/src/extensions/scratch3_video_sensing/library.js b/src/extensions/scratch3_video_sensing/library.js index 6de24214212..6be40003e7f 100644 --- a/src/extensions/scratch3_video_sensing/library.js +++ b/src/extensions/scratch3_video_sensing/library.js @@ -243,7 +243,7 @@ class VideoMotion { } } - // Use the accumalated values from the for loop to determine a + // Use the accumulated values from the for loop to determine a // motion direction. const {u, v} = motionVector(A2, A1B2, B1, C2, C1); @@ -349,7 +349,7 @@ class VideoMotion { } } - // Use the accumalated values from the for loop to determine a + // Use the accumulated values from the for loop to determine a // motion direction. let {u, v} = motionVector(A2, A1B2, B1, C2, C1); diff --git a/src/extensions/scratch3_video_sensing/view.js b/src/extensions/scratch3_video_sensing/view.js index 35623a651c6..e52b0ee84d6 100644 --- a/src/extensions/scratch3_video_sensing/view.js +++ b/src/extensions/scratch3_video_sensing/view.js @@ -90,7 +90,7 @@ const OUTPUT = { /** * Render the horizontal pixel difference times the temporal difference as - * red and the vertical and temporal difference as green. Multiplcation of + * red and the vertical and temporal difference as green. Multiplication of * these values ends up with sharp differences in the output showing edge * details where motion is happening. * @type {number} @@ -121,7 +121,7 @@ const OUTPUT = { UV: 10, /** - * Render cells of mulitple pixels at a step in the motion code that has + * Render cells of multiple pixels at a step in the motion code that has * the same cell values and turns them into motion vectors showing the * amount of motion in the x axis and y axis separately. Those values are a * step away from becoming a motion amount and direction through standard @@ -198,7 +198,7 @@ class VideoMotionView { * Iterate each pixel address location and call a function with that address. * @param {number} xStart - start location on the x axis of the output pixel buffer * @param {number} yStart - start location on the y axis of the output pixel buffer - * @param {nubmer} xStop - location to stop at on the x axis + * @param {number} xStop - location to stop at on the x axis * @param {number} yStop - location to stop at on the y axis * @param {function} fn - handle to call with each iterated address */ @@ -215,7 +215,7 @@ class VideoMotionView { * Iterate over cells of pixels and call a function with a function to * iterate over pixel addresses. * @param {number} xStart - start location on the x axis - * @param {number} yStart - start lcoation on the y axis + * @param {number} yStart - start location on the y axis * @param {number} xStop - location to stop at on the x axis * @param {number} yStop - location to stop at on the y axis * @param {number} xStep - width of the cells diff --git a/src/io/cloud.js b/src/io/cloud.js index 86e64ed79ee..8e201151da0 100644 --- a/src/io/cloud.js +++ b/src/io/cloud.js @@ -35,13 +35,13 @@ class Cloud { /** * Cloud IO Device responsible for sending and receiving messages from - * cloud provider (mananging the cloud server connection) and interacting + * cloud provider (managing the cloud server connection) and interacting * with cloud variables in the current project. * @param {Runtime} runtime The runtime context for this cloud io device. */ constructor (runtime) { /** - * Reference to the cloud data provider, responsible for mananging + * Reference to the cloud data provider, responsible for managing * the web socket connection to the cloud data server. * @type {?CloudProvider} */ diff --git a/src/io/video.js b/src/io/video.js index 65453e3be2b..18d349bffa5 100644 --- a/src/io/video.js +++ b/src/io/video.js @@ -102,7 +102,7 @@ class Video { * * @param {object} frameInfo A descriptor of the frame you would like to receive. * @param {Array.} frameInfo.dimensions [width, height] array of numbers. Defaults to [480,360] - * @param {boolean} frameInfo.mirror If you specificly want a mirror/non-mirror frame, defaults to the global + * @param {boolean} frameInfo.mirror If you specifically want a mirror/non-mirror frame, defaults to the global * mirror state (ioDevices.video.mirror) * @param {string} frameInfo.format Requested video format, available formats are 'image-data' and 'canvas'. * @param {number} frameInfo.cacheTimeout Will reuse previous image data if the time since capture is less than diff --git a/src/playground/benchmark.js b/src/playground/benchmark.js index 85da6b49257..bfbbeddcb0a 100644 --- a/src/playground/benchmark.js +++ b/src/playground/benchmark.js @@ -1,6 +1,6 @@ // Track loading time with timestamps and if possible the performance api. if (window.performance) { - // Mark with the performance API when benchmark.js and its dependecies start + // Mark with the performance API when benchmark.js and its dependencies start // evaluation. This can tell us once measured how long the code spends time // turning into execution code for the first time. Skipping evaluation of // some of the code can help us make it faster. diff --git a/src/serialization/sb2.js b/src/serialization/sb2.js index 5af4d4ecb8d..62555112119 100644 --- a/src/serialization/sb2.js +++ b/src/serialization/sb2.js @@ -161,7 +161,7 @@ const flatten = function (blocks) { * or a list of blocks in an argument (e.g., move [pick random...]). * @param {Array.} blockList SB2 JSON-format block list. * @param {Function} addBroadcastMsg function to update broadcast message name map - * @param {Function} getVariableId function to retreive a variable's ID based on name + * @param {Function} getVariableId function to retrieve a variable's ID based on name * @param {ImportedExtensionsInfo} extensions - (in/out) parsed extension information will be stored here. * @param {ParseState} parseState - info on the state of parsing beyond the current block. * @param {object} comments - Comments from sb2 project that need to be attached to blocks. @@ -202,7 +202,7 @@ const parseBlockList = function (blockList, addBroadcastMsg, getVariableId, exte * @param {!object} scripts Scripts object from SB2 JSON. * @param {!Blocks} blocks Blocks object to load parsed blocks into. * @param {Function} addBroadcastMsg function to update broadcast message name map - * @param {Function} getVariableId function to retreive a variable's ID based on name + * @param {Function} getVariableId function to retrieve a variable's ID based on name * @param {ImportedExtensionsInfo} extensions - (in/out) parsed extension information will be stored here. * @param {object} comments Comments that need to be attached to the blocks that need to be parsed */ @@ -379,7 +379,7 @@ const parseMonitorObject = (object, runtime, targets, extensions) => { block.id = block.opcode; } - // Block needs a targetId if it is targetting something other than the stage + // Block needs a targetId if it is targeting something other than the stage block.targetId = target.isStage ? null : target.id; // Property required for running monitored blocks. diff --git a/src/serialization/sb3.js b/src/serialization/sb3.js index 84280a584c0..506b9a01754 100644 --- a/src/serialization/sb3.js +++ b/src/serialization/sb3.js @@ -106,7 +106,7 @@ const UPSTREAM_MAX_COMMENT_LENGTH = 8000; * or null if the given block is not one of the primitives described above. */ const serializePrimitiveBlock = function (block) { - // Returns an array represeting a primitive block or null if not one of + // Returns an array representing a primitive block or null if not one of // the primitive types above if (hasOwnProperty.call(primitiveOpcodeInfoMap, block.opcode)) { const primitiveInfo = primitiveOpcodeInfoMap[block.opcode]; @@ -998,7 +998,7 @@ const deserializeFields = function (fields) { }; /** - * Covnert serialized INPUT and FIELD primitives back to hydrated block templates. + * Convert serialized INPUT and FIELD primitives back to hydrated block templates. * Should be able to deserialize a format that has already been deserialized. The only * "east" path to adding new targets/code requires going through deserialize, so it should * work with pre-parsed deserialized blocks. @@ -1143,7 +1143,7 @@ const fixSporkCompatibility = function (blocks) { } // control_stop used to define a mutation for whether it has a connection below, which is what old - // scratch-blocks relies on to determine if there is another conneciton below or not. Spork does not define + // scratch-blocks relies on to determine if there is another connection below or not. Spork does not define // this mutation and relies only on the STOP_OPTION field. We will generate the mutation if it's missing so // that a "stop other scripts in sprite" block doesn't cause the workspace to fail to load. case 'control_stop': { @@ -1475,7 +1475,7 @@ const replaceUnsafeCharsInVariableIds = function (targets) { }); }); - // Replace the IDs in the blocks refrencing variables or lists + // Replace the IDs in the blocks referencing variables or lists for (const id in allVarRefs) { const newId = StringUtil.replaceUnsafeChars(id); if (id === newId) continue; // ID was already safe, skip diff --git a/src/util/math-util.js b/src/util/math-util.js index bce666b9253..962500d428d 100644 --- a/src/util/math-util.js +++ b/src/util/math-util.js @@ -85,7 +85,7 @@ class MathUtil { * For instance, (1, 5, 3) will only pick 1, 2, 4, or 5 (with equal * probability) * - * @param {number} lower - The lower bound (inlcusive) + * @param {number} lower - The lower bound (inclusive) * @param {number} upper - The upper bound (inclusive), such that lower <= upper * @param {number} excluded - The number to exclude (MUST be in the range) * @return {number} A random integer in the range [lower, upper] that is not "excluded" diff --git a/src/util/string-util.js b/src/util/string-util.js index 59550b6b29b..f27edf798a9 100644 --- a/src/util/string-util.js +++ b/src/util/string-util.js @@ -89,7 +89,7 @@ class StringUtil { // See #1030 unsafe = String(unsafe); } else { - log.error('Unexpected input recieved in replaceUnsafeChars'); + log.error('Unexpected input received in replaceUnsafeChars'); return unsafe; } } diff --git a/src/util/xml-escape.js b/src/util/xml-escape.js index eebad772f55..29b53d65a6a 100644 --- a/src/util/xml-escape.js +++ b/src/util/xml-escape.js @@ -15,7 +15,7 @@ const xmlEscape = function (unsafe) { // See #1030 unsafe = String(unsafe); } else { - log.error('Unexpected input recieved in replaceUnsafeChars'); + log.error('Unexpected input received in replaceUnsafeChars'); return unsafe; } } diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 2cc5d260c73..8a4f3a7d195 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -267,7 +267,7 @@ class VirtualMachine extends EventEmitter { } /** - * @deprecated Used by old versions of TurboWarp. Superceded by upstream's quit() + * @deprecated Used by old versions of TurboWarp. Superseded by upstream's quit() */ stop () { this.quit(); @@ -917,7 +917,7 @@ class VirtualMachine extends EventEmitter { /** * Add a single sb3 sprite. - * @param {object} sprite Object rperesenting 3.0 sprite to be added. + * @param {object} sprite Object representing 3.0 sprite to be added. * @param {?ArrayBuffer} zip Optional zip of assets being referenced by target json * @returns {Promise} Promise that resolves after the sprite is added */ @@ -1801,7 +1801,7 @@ class VirtualMachine extends EventEmitter { } /** - * Reorder the sounds of a target if it exists. Return whether it occured. + * Reorder the sounds of a target if it exists. Return whether it occurred. * @param {!string} targetId ID of the target which owns the sounds. * @param {!number} soundIndex index of the sound to move. * @param {!number} newIndex index that the sound should be moved to.