Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/blocks/scratch3_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/scratch3_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
22 changes: 11 additions & 11 deletions src/compiler/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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 */
Expand Down Expand Up @@ -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',
Expand Down
10 changes: 5 additions & 5 deletions src/compiler/irgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -99,8 +99,8 @@ class ScriptTreeGenerator {
}

this.oldCompilerStub = (
oldCompilerCompatiblity.enabled ?
new oldCompilerCompatiblity.ScriptTreeGeneratorStub(this) :
oldCompilerCompatibility.enabled ?
new oldCompilerCompatibility.ScriptTreeGeneratorStub(this) :
null
);
}
Expand Down Expand Up @@ -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, {
Expand Down Expand Up @@ -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([
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/jsgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/engine/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.<string, object>}
*/
scripts: {},
Expand Down
6 changes: 3 additions & 3 deletions src/engine/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/engine/profiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
*/
Expand Down Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions src/engine/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down Expand Up @@ -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();

/**
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/engine/sequencer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/engine/target.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Target extends EventEmitter {
}

/**
* Clear all edge-activaed hat values.
* Clear all edge-activated hat values.
*/
clearEdgeActivatedValues () {
this._edgeActivatedHatValues = {};
Expand Down Expand Up @@ -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];
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/extension-support/block-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand Down
4 changes: 2 additions & 2 deletions src/extensions/scratch3_ev3/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/scratch3_gdx_for/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/scratch3_microbit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
2 changes: 1 addition & 1 deletion src/extensions/scratch3_music/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/extensions/scratch3_pen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
Loading
Loading