mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-22 22:12:28 -05:00
Fix quote-props
This commit is contained in:
parent
0e909cb9a5
commit
7712b2902f
15 changed files with 800 additions and 800 deletions
|
@ -15,22 +15,22 @@ var Scratch3ControlBlocks = function (runtime) {
|
|||
*/
|
||||
Scratch3ControlBlocks.prototype.getPrimitives = function () {
|
||||
return {
|
||||
'control_repeat': this.repeat,
|
||||
'control_repeat_until': this.repeatUntil,
|
||||
'control_forever': this.forever,
|
||||
'control_wait': this.wait,
|
||||
'control_wait_until': this.waitUntil,
|
||||
'control_if': this.if,
|
||||
'control_if_else': this.ifElse,
|
||||
'control_stop': this.stop,
|
||||
'control_create_clone_of': this.createClone,
|
||||
'control_delete_this_clone': this.deleteClone
|
||||
control_repeat: this.repeat,
|
||||
control_repeat_until: this.repeatUntil,
|
||||
control_forever: this.forever,
|
||||
control_wait: this.wait,
|
||||
control_wait_until: this.waitUntil,
|
||||
control_if: this.if,
|
||||
control_if_else: this.ifElse,
|
||||
control_stop: this.stop,
|
||||
control_create_clone_of: this.createClone,
|
||||
control_delete_this_clone: this.deleteClone
|
||||
};
|
||||
};
|
||||
|
||||
Scratch3ControlBlocks.prototype.getHats = function () {
|
||||
return {
|
||||
'control_start_as_clone': {
|
||||
control_start_as_clone: {
|
||||
restartExistingThreads: false
|
||||
}
|
||||
};
|
||||
|
|
|
@ -14,17 +14,17 @@ var Scratch3DataBlocks = function (runtime) {
|
|||
*/
|
||||
Scratch3DataBlocks.prototype.getPrimitives = function () {
|
||||
return {
|
||||
'data_variable': this.getVariable,
|
||||
'data_setvariableto': this.setVariableTo,
|
||||
'data_changevariableby': this.changeVariableBy,
|
||||
'data_listcontents': this.getListContents,
|
||||
'data_addtolist': this.addToList,
|
||||
'data_deleteoflist': this.deleteOfList,
|
||||
'data_insertatlist': this.insertAtList,
|
||||
'data_replaceitemoflist': this.replaceItemOfList,
|
||||
'data_itemoflist': this.getItemOfList,
|
||||
'data_lengthoflist': this.lengthOfList,
|
||||
'data_listcontainsitem': this.listContainsItem
|
||||
data_variable: this.getVariable,
|
||||
data_setvariableto: this.setVariableTo,
|
||||
data_changevariableby: this.changeVariableBy,
|
||||
data_listcontents: this.getListContents,
|
||||
data_addtolist: this.addToList,
|
||||
data_deleteoflist: this.deleteOfList,
|
||||
data_insertatlist: this.insertAtList,
|
||||
data_replaceitemoflist: this.replaceItemOfList,
|
||||
data_itemoflist: this.getItemOfList,
|
||||
data_lengthoflist: this.lengthOfList,
|
||||
data_listcontainsitem: this.listContainsItem
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -14,31 +14,31 @@ var Scratch3EventBlocks = function (runtime) {
|
|||
*/
|
||||
Scratch3EventBlocks.prototype.getPrimitives = function () {
|
||||
return {
|
||||
'event_broadcast': this.broadcast,
|
||||
'event_broadcastandwait': this.broadcastAndWait,
|
||||
'event_whengreaterthan': this.hatGreaterThanPredicate
|
||||
event_broadcast: this.broadcast,
|
||||
event_broadcastandwait: this.broadcastAndWait,
|
||||
event_whengreaterthan: this.hatGreaterThanPredicate
|
||||
};
|
||||
};
|
||||
|
||||
Scratch3EventBlocks.prototype.getHats = function () {
|
||||
return {
|
||||
'event_whenflagclicked': {
|
||||
event_whenflagclicked: {
|
||||
restartExistingThreads: true
|
||||
},
|
||||
'event_whenkeypressed': {
|
||||
event_whenkeypressed: {
|
||||
restartExistingThreads: false
|
||||
},
|
||||
'event_whenthisspriteclicked': {
|
||||
event_whenthisspriteclicked: {
|
||||
restartExistingThreads: true
|
||||
},
|
||||
'event_whenbackdropswitchesto': {
|
||||
event_whenbackdropswitchesto: {
|
||||
restartExistingThreads: true
|
||||
},
|
||||
'event_whengreaterthan': {
|
||||
event_whengreaterthan: {
|
||||
restartExistingThreads: false,
|
||||
edgeActivated: true
|
||||
},
|
||||
'event_whenbroadcastreceived': {
|
||||
event_whenbroadcastreceived: {
|
||||
restartExistingThreads: true
|
||||
}
|
||||
};
|
||||
|
@ -57,7 +57,7 @@ Scratch3EventBlocks.prototype.hatGreaterThanPredicate = function (args, util) {
|
|||
Scratch3EventBlocks.prototype.broadcast = function (args, util) {
|
||||
var broadcastOption = Cast.toString(args.BROADCAST_OPTION);
|
||||
util.startHats('event_whenbroadcastreceived', {
|
||||
'BROADCAST_OPTION': broadcastOption
|
||||
BROADCAST_OPTION: broadcastOption
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -68,7 +68,7 @@ Scratch3EventBlocks.prototype.broadcastAndWait = function (args, util) {
|
|||
// No - start hats for this broadcast.
|
||||
util.stackFrame.startedThreads = util.startHats(
|
||||
'event_whenbroadcastreceived', {
|
||||
'BROADCAST_OPTION': broadcastOption
|
||||
BROADCAST_OPTION: broadcastOption
|
||||
}
|
||||
);
|
||||
if (util.stackFrame.startedThreads.length === 0) {
|
||||
|
|
|
@ -14,28 +14,28 @@ var Scratch3LooksBlocks = function (runtime) {
|
|||
*/
|
||||
Scratch3LooksBlocks.prototype.getPrimitives = function () {
|
||||
return {
|
||||
'looks_say': this.say,
|
||||
'looks_sayforsecs': this.sayforsecs,
|
||||
'looks_think': this.think,
|
||||
'looks_thinkforsecs': this.sayforsecs,
|
||||
'looks_show': this.show,
|
||||
'looks_hide': this.hide,
|
||||
'looks_switchcostumeto': this.switchCostume,
|
||||
'looks_switchbackdropto': this.switchBackdrop,
|
||||
'looks_switchbackdroptoandwait': this.switchBackdropAndWait,
|
||||
'looks_nextcostume': this.nextCostume,
|
||||
'looks_nextbackdrop': this.nextBackdrop,
|
||||
'looks_changeeffectby': this.changeEffect,
|
||||
'looks_seteffectto': this.setEffect,
|
||||
'looks_cleargraphiceffects': this.clearEffects,
|
||||
'looks_changesizeby': this.changeSize,
|
||||
'looks_setsizeto': this.setSize,
|
||||
'looks_gotofront': this.goToFront,
|
||||
'looks_gobacklayers': this.goBackLayers,
|
||||
'looks_size': this.getSize,
|
||||
'looks_costumeorder': this.getCostumeIndex,
|
||||
'looks_backdroporder': this.getBackdropIndex,
|
||||
'looks_backdropname': this.getBackdropName
|
||||
looks_say: this.say,
|
||||
looks_sayforsecs: this.sayforsecs,
|
||||
looks_think: this.think,
|
||||
looks_thinkforsecs: this.sayforsecs,
|
||||
looks_show: this.show,
|
||||
looks_hide: this.hide,
|
||||
looks_switchcostumeto: this.switchCostume,
|
||||
looks_switchbackdropto: this.switchBackdrop,
|
||||
looks_switchbackdroptoandwait: this.switchBackdropAndWait,
|
||||
looks_nextcostume: this.nextCostume,
|
||||
looks_nextbackdrop: this.nextBackdrop,
|
||||
looks_changeeffectby: this.changeEffect,
|
||||
looks_seteffectto: this.setEffect,
|
||||
looks_cleargraphiceffects: this.clearEffects,
|
||||
looks_changesizeby: this.changeSize,
|
||||
looks_setsizeto: this.setSize,
|
||||
looks_gotofront: this.goToFront,
|
||||
looks_gobacklayers: this.goBackLayers,
|
||||
looks_size: this.getSize,
|
||||
looks_costumeorder: this.getCostumeIndex,
|
||||
looks_backdroporder: this.getBackdropIndex,
|
||||
looks_backdropname: this.getBackdropName
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -112,7 +112,7 @@ Scratch3LooksBlocks.prototype._setCostumeOrBackdrop = function (target,
|
|||
// Target is the stage - start hats.
|
||||
var newName = target.sprite.costumes[target.currentCostume].name;
|
||||
return this.runtime.startHats('event_whenbackdropswitchesto', {
|
||||
'BACKDROP': newName
|
||||
BACKDROP: newName
|
||||
});
|
||||
}
|
||||
return [];
|
||||
|
|
|
@ -16,23 +16,23 @@ var Scratch3MotionBlocks = function (runtime) {
|
|||
*/
|
||||
Scratch3MotionBlocks.prototype.getPrimitives = function () {
|
||||
return {
|
||||
'motion_movesteps': this.moveSteps,
|
||||
'motion_gotoxy': this.goToXY,
|
||||
'motion_goto': this.goTo,
|
||||
'motion_turnright': this.turnRight,
|
||||
'motion_turnleft': this.turnLeft,
|
||||
'motion_pointindirection': this.pointInDirection,
|
||||
'motion_pointtowards': this.pointTowards,
|
||||
'motion_glidesecstoxy': this.glide,
|
||||
'motion_ifonedgebounce': this.ifOnEdgeBounce,
|
||||
'motion_setrotationstyle': this.setRotationStyle,
|
||||
'motion_changexby': this.changeX,
|
||||
'motion_setx': this.setX,
|
||||
'motion_changeyby': this.changeY,
|
||||
'motion_sety': this.setY,
|
||||
'motion_xposition': this.getX,
|
||||
'motion_yposition': this.getY,
|
||||
'motion_direction': this.getDirection
|
||||
motion_movesteps: this.moveSteps,
|
||||
motion_gotoxy: this.goToXY,
|
||||
motion_goto: this.goTo,
|
||||
motion_turnright: this.turnRight,
|
||||
motion_turnleft: this.turnLeft,
|
||||
motion_pointindirection: this.pointInDirection,
|
||||
motion_pointtowards: this.pointTowards,
|
||||
motion_glidesecstoxy: this.glide,
|
||||
motion_ifonedgebounce: this.ifOnEdgeBounce,
|
||||
motion_setrotationstyle: this.setRotationStyle,
|
||||
motion_changexby: this.changeX,
|
||||
motion_setx: this.setX,
|
||||
motion_changeyby: this.changeY,
|
||||
motion_sety: this.setY,
|
||||
motion_xposition: this.getX,
|
||||
motion_yposition: this.getY,
|
||||
motion_direction: this.getDirection
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -14,23 +14,23 @@ var Scratch3OperatorsBlocks = function (runtime) {
|
|||
*/
|
||||
Scratch3OperatorsBlocks.prototype.getPrimitives = function () {
|
||||
return {
|
||||
'operator_add': this.add,
|
||||
'operator_subtract': this.subtract,
|
||||
'operator_multiply': this.multiply,
|
||||
'operator_divide': this.divide,
|
||||
'operator_lt': this.lt,
|
||||
'operator_equals': this.equals,
|
||||
'operator_gt': this.gt,
|
||||
'operator_and': this.and,
|
||||
'operator_or': this.or,
|
||||
'operator_not': this.not,
|
||||
'operator_random': this.random,
|
||||
'operator_join': this.join,
|
||||
'operator_letter_of': this.letterOf,
|
||||
'operator_length': this.length,
|
||||
'operator_mod': this.mod,
|
||||
'operator_round': this.round,
|
||||
'operator_mathop': this.mathop
|
||||
operator_add: this.add,
|
||||
operator_subtract: this.subtract,
|
||||
operator_multiply: this.multiply,
|
||||
operator_divide: this.divide,
|
||||
operator_lt: this.lt,
|
||||
operator_equals: this.equals,
|
||||
operator_gt: this.gt,
|
||||
operator_and: this.and,
|
||||
operator_or: this.or,
|
||||
operator_not: this.not,
|
||||
operator_random: this.random,
|
||||
operator_join: this.join,
|
||||
operator_letter_of: this.letterOf,
|
||||
operator_length: this.length,
|
||||
operator_mod: this.mod,
|
||||
operator_round: this.round,
|
||||
operator_mathop: this.mathop
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ var Scratch3ProcedureBlocks = function (runtime) {
|
|||
*/
|
||||
Scratch3ProcedureBlocks.prototype.getPrimitives = function () {
|
||||
return {
|
||||
'procedures_defnoreturn': this.defNoReturn,
|
||||
'procedures_callnoreturn': this.callNoReturn,
|
||||
'procedures_param': this.param
|
||||
procedures_defnoreturn: this.defNoReturn,
|
||||
procedures_callnoreturn: this.callNoReturn,
|
||||
procedures_param: this.param
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -14,18 +14,18 @@ var Scratch3SensingBlocks = function (runtime) {
|
|||
*/
|
||||
Scratch3SensingBlocks.prototype.getPrimitives = function () {
|
||||
return {
|
||||
'sensing_touchingobject': this.touchingObject,
|
||||
'sensing_touchingcolor': this.touchingColor,
|
||||
'sensing_coloristouchingcolor': this.colorTouchingColor,
|
||||
'sensing_distanceto': this.distanceTo,
|
||||
'sensing_timer': this.getTimer,
|
||||
'sensing_resettimer': this.resetTimer,
|
||||
'sensing_mousex': this.getMouseX,
|
||||
'sensing_mousey': this.getMouseY,
|
||||
'sensing_mousedown': this.getMouseDown,
|
||||
'sensing_keypressed': this.getKeyPressed,
|
||||
'sensing_current': this.current,
|
||||
'sensing_dayssince2000': this.daysSince2000
|
||||
sensing_touchingobject: this.touchingObject,
|
||||
sensing_touchingcolor: this.touchingColor,
|
||||
sensing_coloristouchingcolor: this.colorTouchingColor,
|
||||
sensing_distanceto: this.distanceTo,
|
||||
sensing_timer: this.getTimer,
|
||||
sensing_resettimer: this.resetTimer,
|
||||
sensing_mousex: this.getMouseX,
|
||||
sensing_mousey: this.getMouseY,
|
||||
sensing_mousedown: this.getMouseDown,
|
||||
sensing_keypressed: this.getKeyPressed,
|
||||
sensing_current: this.current,
|
||||
sensing_dayssince2000: this.daysSince2000
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -10,14 +10,14 @@ var Keyboard = require('../io/keyboard');
|
|||
var Mouse = require('../io/mouse');
|
||||
|
||||
var defaultBlockPackages = {
|
||||
'scratch3_control': require('../blocks/scratch3_control'),
|
||||
'scratch3_event': require('../blocks/scratch3_event'),
|
||||
'scratch3_looks': require('../blocks/scratch3_looks'),
|
||||
'scratch3_motion': require('../blocks/scratch3_motion'),
|
||||
'scratch3_operators': require('../blocks/scratch3_operators'),
|
||||
'scratch3_sensing': require('../blocks/scratch3_sensing'),
|
||||
'scratch3_data': require('../blocks/scratch3_data'),
|
||||
'scratch3_procedures': require('../blocks/scratch3_procedures')
|
||||
scratch3_control: require('../blocks/scratch3_control'),
|
||||
scratch3_event: require('../blocks/scratch3_event'),
|
||||
scratch3_looks: require('../blocks/scratch3_looks'),
|
||||
scratch3_motion: require('../blocks/scratch3_motion'),
|
||||
scratch3_operators: require('../blocks/scratch3_operators'),
|
||||
scratch3_sensing: require('../blocks/scratch3_sensing'),
|
||||
scratch3_data: require('../blocks/scratch3_data'),
|
||||
scratch3_procedures: require('../blocks/scratch3_procedures')
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -139,9 +139,9 @@ var Runtime = function () {
|
|||
// I/O related data.
|
||||
/** @type {Object.<string, Object>} */
|
||||
this.ioDevices = {
|
||||
'clock': new Clock(),
|
||||
'keyboard': new Keyboard(this),
|
||||
'mouse': new Mouse(this)
|
||||
clock: new Clock(),
|
||||
keyboard: new Keyboard(this),
|
||||
mouse: new Mouse(this)
|
||||
};
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -311,7 +311,7 @@ VirtualMachine.prototype.emitTargetsUpdate = function () {
|
|||
*/
|
||||
VirtualMachine.prototype.emitWorkspaceUpdate = function () {
|
||||
this.emit('workspaceUpdate', {
|
||||
'xml': this.editingTarget.blocks.toXML()
|
||||
xml: this.editingTarget.blocks.toXML()
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -62,10 +62,10 @@ Keyboard.prototype.postData = function (data) {
|
|||
}
|
||||
// Always trigger hats, even if it was already pressed.
|
||||
this.runtime.startHats('event_whenkeypressed', {
|
||||
'KEY_OPTION': this._keyCodeToScratchKey(data.keyCode)
|
||||
KEY_OPTION: this._keyCodeToScratchKey(data.keyCode)
|
||||
});
|
||||
this.runtime.startHats('event_whenkeypressed', {
|
||||
'KEY_OPTION': 'any'
|
||||
KEY_OPTION: 'any'
|
||||
});
|
||||
} else if (index > -1) {
|
||||
// If already present, remove from the list.
|
||||
|
|
|
@ -37,13 +37,13 @@ var Clone = function (sprite, runtime) {
|
|||
* @type {!Object.<string, number>}
|
||||
*/
|
||||
this.effects = {
|
||||
'color': 0,
|
||||
'fisheye': 0,
|
||||
'whirl': 0,
|
||||
'pixelate': 0,
|
||||
'mosaic': 0,
|
||||
'brightness': 0,
|
||||
'ghost': 0
|
||||
color: 0,
|
||||
fisheye: 0,
|
||||
whirl: 0,
|
||||
pixelate: 0,
|
||||
mosaic: 0,
|
||||
brightness: 0,
|
||||
ghost: 0
|
||||
};
|
||||
};
|
||||
util.inherits(Clone, Target);
|
||||
|
|
|
@ -326,7 +326,7 @@ test('move no obscure shadow', function (t) {
|
|||
next: null,
|
||||
fields: {},
|
||||
inputs: {
|
||||
'fooInput': {
|
||||
fooInput: {
|
||||
name: 'fooInput',
|
||||
block: 'x',
|
||||
shadow: 'y'
|
||||
|
|
|
@ -50,7 +50,7 @@ module.exports = [
|
|||
// Webpack-compatible
|
||||
defaultsDeep({}, base, {
|
||||
entry: {
|
||||
'dist': './src/index.js'
|
||||
dist: './src/index.js'
|
||||
},
|
||||
|
||||
output: {
|
||||
|
@ -63,8 +63,8 @@ module.exports = [
|
|||
// Playground
|
||||
defaultsDeep({}, base, {
|
||||
entry: {
|
||||
'vm': './src/index.js',
|
||||
'vendor': [
|
||||
vm: './src/index.js',
|
||||
vendor: [
|
||||
// FPS counter
|
||||
'stats.js/build/stats.min.js',
|
||||
// Syntax highlighter
|
||||
|
|
Loading…
Reference in a new issue