Fix quote-props

This commit is contained in:
Ray Schamp 2016-10-24 11:02:19 -04:00
parent 0e909cb9a5
commit 7712b2902f
15 changed files with 800 additions and 800 deletions

View file

@ -15,22 +15,22 @@ var Scratch3ControlBlocks = function (runtime) {
*/ */
Scratch3ControlBlocks.prototype.getPrimitives = function () { Scratch3ControlBlocks.prototype.getPrimitives = function () {
return { return {
'control_repeat': this.repeat, control_repeat: this.repeat,
'control_repeat_until': this.repeatUntil, control_repeat_until: this.repeatUntil,
'control_forever': this.forever, control_forever: this.forever,
'control_wait': this.wait, control_wait: this.wait,
'control_wait_until': this.waitUntil, control_wait_until: this.waitUntil,
'control_if': this.if, control_if: this.if,
'control_if_else': this.ifElse, control_if_else: this.ifElse,
'control_stop': this.stop, control_stop: this.stop,
'control_create_clone_of': this.createClone, control_create_clone_of: this.createClone,
'control_delete_this_clone': this.deleteClone control_delete_this_clone: this.deleteClone
}; };
}; };
Scratch3ControlBlocks.prototype.getHats = function () { Scratch3ControlBlocks.prototype.getHats = function () {
return { return {
'control_start_as_clone': { control_start_as_clone: {
restartExistingThreads: false restartExistingThreads: false
} }
}; };

View file

@ -14,17 +14,17 @@ var Scratch3DataBlocks = function (runtime) {
*/ */
Scratch3DataBlocks.prototype.getPrimitives = function () { Scratch3DataBlocks.prototype.getPrimitives = function () {
return { return {
'data_variable': this.getVariable, data_variable: this.getVariable,
'data_setvariableto': this.setVariableTo, data_setvariableto: this.setVariableTo,
'data_changevariableby': this.changeVariableBy, data_changevariableby: this.changeVariableBy,
'data_listcontents': this.getListContents, data_listcontents: this.getListContents,
'data_addtolist': this.addToList, data_addtolist: this.addToList,
'data_deleteoflist': this.deleteOfList, data_deleteoflist: this.deleteOfList,
'data_insertatlist': this.insertAtList, data_insertatlist: this.insertAtList,
'data_replaceitemoflist': this.replaceItemOfList, data_replaceitemoflist: this.replaceItemOfList,
'data_itemoflist': this.getItemOfList, data_itemoflist: this.getItemOfList,
'data_lengthoflist': this.lengthOfList, data_lengthoflist: this.lengthOfList,
'data_listcontainsitem': this.listContainsItem data_listcontainsitem: this.listContainsItem
}; };
}; };

View file

@ -14,31 +14,31 @@ var Scratch3EventBlocks = function (runtime) {
*/ */
Scratch3EventBlocks.prototype.getPrimitives = function () { Scratch3EventBlocks.prototype.getPrimitives = function () {
return { return {
'event_broadcast': this.broadcast, event_broadcast: this.broadcast,
'event_broadcastandwait': this.broadcastAndWait, event_broadcastandwait: this.broadcastAndWait,
'event_whengreaterthan': this.hatGreaterThanPredicate event_whengreaterthan: this.hatGreaterThanPredicate
}; };
}; };
Scratch3EventBlocks.prototype.getHats = function () { Scratch3EventBlocks.prototype.getHats = function () {
return { return {
'event_whenflagclicked': { event_whenflagclicked: {
restartExistingThreads: true restartExistingThreads: true
}, },
'event_whenkeypressed': { event_whenkeypressed: {
restartExistingThreads: false restartExistingThreads: false
}, },
'event_whenthisspriteclicked': { event_whenthisspriteclicked: {
restartExistingThreads: true restartExistingThreads: true
}, },
'event_whenbackdropswitchesto': { event_whenbackdropswitchesto: {
restartExistingThreads: true restartExistingThreads: true
}, },
'event_whengreaterthan': { event_whengreaterthan: {
restartExistingThreads: false, restartExistingThreads: false,
edgeActivated: true edgeActivated: true
}, },
'event_whenbroadcastreceived': { event_whenbroadcastreceived: {
restartExistingThreads: true restartExistingThreads: true
} }
}; };
@ -57,7 +57,7 @@ Scratch3EventBlocks.prototype.hatGreaterThanPredicate = function (args, util) {
Scratch3EventBlocks.prototype.broadcast = function (args, util) { Scratch3EventBlocks.prototype.broadcast = function (args, util) {
var broadcastOption = Cast.toString(args.BROADCAST_OPTION); var broadcastOption = Cast.toString(args.BROADCAST_OPTION);
util.startHats('event_whenbroadcastreceived', { 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. // No - start hats for this broadcast.
util.stackFrame.startedThreads = util.startHats( util.stackFrame.startedThreads = util.startHats(
'event_whenbroadcastreceived', { 'event_whenbroadcastreceived', {
'BROADCAST_OPTION': broadcastOption BROADCAST_OPTION: broadcastOption
} }
); );
if (util.stackFrame.startedThreads.length === 0) { if (util.stackFrame.startedThreads.length === 0) {

View file

@ -14,28 +14,28 @@ var Scratch3LooksBlocks = function (runtime) {
*/ */
Scratch3LooksBlocks.prototype.getPrimitives = function () { Scratch3LooksBlocks.prototype.getPrimitives = function () {
return { return {
'looks_say': this.say, looks_say: this.say,
'looks_sayforsecs': this.sayforsecs, looks_sayforsecs: this.sayforsecs,
'looks_think': this.think, looks_think: this.think,
'looks_thinkforsecs': this.sayforsecs, looks_thinkforsecs: this.sayforsecs,
'looks_show': this.show, looks_show: this.show,
'looks_hide': this.hide, looks_hide: this.hide,
'looks_switchcostumeto': this.switchCostume, looks_switchcostumeto: this.switchCostume,
'looks_switchbackdropto': this.switchBackdrop, looks_switchbackdropto: this.switchBackdrop,
'looks_switchbackdroptoandwait': this.switchBackdropAndWait, looks_switchbackdroptoandwait: this.switchBackdropAndWait,
'looks_nextcostume': this.nextCostume, looks_nextcostume: this.nextCostume,
'looks_nextbackdrop': this.nextBackdrop, looks_nextbackdrop: this.nextBackdrop,
'looks_changeeffectby': this.changeEffect, looks_changeeffectby: this.changeEffect,
'looks_seteffectto': this.setEffect, looks_seteffectto: this.setEffect,
'looks_cleargraphiceffects': this.clearEffects, looks_cleargraphiceffects: this.clearEffects,
'looks_changesizeby': this.changeSize, looks_changesizeby: this.changeSize,
'looks_setsizeto': this.setSize, looks_setsizeto: this.setSize,
'looks_gotofront': this.goToFront, looks_gotofront: this.goToFront,
'looks_gobacklayers': this.goBackLayers, looks_gobacklayers: this.goBackLayers,
'looks_size': this.getSize, looks_size: this.getSize,
'looks_costumeorder': this.getCostumeIndex, looks_costumeorder: this.getCostumeIndex,
'looks_backdroporder': this.getBackdropIndex, looks_backdroporder: this.getBackdropIndex,
'looks_backdropname': this.getBackdropName looks_backdropname: this.getBackdropName
}; };
}; };
@ -112,7 +112,7 @@ Scratch3LooksBlocks.prototype._setCostumeOrBackdrop = function (target,
// Target is the stage - start hats. // Target is the stage - start hats.
var newName = target.sprite.costumes[target.currentCostume].name; var newName = target.sprite.costumes[target.currentCostume].name;
return this.runtime.startHats('event_whenbackdropswitchesto', { return this.runtime.startHats('event_whenbackdropswitchesto', {
'BACKDROP': newName BACKDROP: newName
}); });
} }
return []; return [];

View file

@ -16,23 +16,23 @@ var Scratch3MotionBlocks = function (runtime) {
*/ */
Scratch3MotionBlocks.prototype.getPrimitives = function () { Scratch3MotionBlocks.prototype.getPrimitives = function () {
return { return {
'motion_movesteps': this.moveSteps, motion_movesteps: this.moveSteps,
'motion_gotoxy': this.goToXY, motion_gotoxy: this.goToXY,
'motion_goto': this.goTo, motion_goto: this.goTo,
'motion_turnright': this.turnRight, motion_turnright: this.turnRight,
'motion_turnleft': this.turnLeft, motion_turnleft: this.turnLeft,
'motion_pointindirection': this.pointInDirection, motion_pointindirection: this.pointInDirection,
'motion_pointtowards': this.pointTowards, motion_pointtowards: this.pointTowards,
'motion_glidesecstoxy': this.glide, motion_glidesecstoxy: this.glide,
'motion_ifonedgebounce': this.ifOnEdgeBounce, motion_ifonedgebounce: this.ifOnEdgeBounce,
'motion_setrotationstyle': this.setRotationStyle, motion_setrotationstyle: this.setRotationStyle,
'motion_changexby': this.changeX, motion_changexby: this.changeX,
'motion_setx': this.setX, motion_setx: this.setX,
'motion_changeyby': this.changeY, motion_changeyby: this.changeY,
'motion_sety': this.setY, motion_sety: this.setY,
'motion_xposition': this.getX, motion_xposition: this.getX,
'motion_yposition': this.getY, motion_yposition: this.getY,
'motion_direction': this.getDirection motion_direction: this.getDirection
}; };
}; };

View file

@ -14,23 +14,23 @@ var Scratch3OperatorsBlocks = function (runtime) {
*/ */
Scratch3OperatorsBlocks.prototype.getPrimitives = function () { Scratch3OperatorsBlocks.prototype.getPrimitives = function () {
return { return {
'operator_add': this.add, operator_add: this.add,
'operator_subtract': this.subtract, operator_subtract: this.subtract,
'operator_multiply': this.multiply, operator_multiply: this.multiply,
'operator_divide': this.divide, operator_divide: this.divide,
'operator_lt': this.lt, operator_lt: this.lt,
'operator_equals': this.equals, operator_equals: this.equals,
'operator_gt': this.gt, operator_gt: this.gt,
'operator_and': this.and, operator_and: this.and,
'operator_or': this.or, operator_or: this.or,
'operator_not': this.not, operator_not: this.not,
'operator_random': this.random, operator_random: this.random,
'operator_join': this.join, operator_join: this.join,
'operator_letter_of': this.letterOf, operator_letter_of: this.letterOf,
'operator_length': this.length, operator_length: this.length,
'operator_mod': this.mod, operator_mod: this.mod,
'operator_round': this.round, operator_round: this.round,
'operator_mathop': this.mathop operator_mathop: this.mathop
}; };
}; };

View file

@ -12,9 +12,9 @@ var Scratch3ProcedureBlocks = function (runtime) {
*/ */
Scratch3ProcedureBlocks.prototype.getPrimitives = function () { Scratch3ProcedureBlocks.prototype.getPrimitives = function () {
return { return {
'procedures_defnoreturn': this.defNoReturn, procedures_defnoreturn: this.defNoReturn,
'procedures_callnoreturn': this.callNoReturn, procedures_callnoreturn: this.callNoReturn,
'procedures_param': this.param procedures_param: this.param
}; };
}; };

View file

@ -14,18 +14,18 @@ var Scratch3SensingBlocks = function (runtime) {
*/ */
Scratch3SensingBlocks.prototype.getPrimitives = function () { Scratch3SensingBlocks.prototype.getPrimitives = function () {
return { return {
'sensing_touchingobject': this.touchingObject, sensing_touchingobject: this.touchingObject,
'sensing_touchingcolor': this.touchingColor, sensing_touchingcolor: this.touchingColor,
'sensing_coloristouchingcolor': this.colorTouchingColor, sensing_coloristouchingcolor: this.colorTouchingColor,
'sensing_distanceto': this.distanceTo, sensing_distanceto: this.distanceTo,
'sensing_timer': this.getTimer, sensing_timer: this.getTimer,
'sensing_resettimer': this.resetTimer, sensing_resettimer: this.resetTimer,
'sensing_mousex': this.getMouseX, sensing_mousex: this.getMouseX,
'sensing_mousey': this.getMouseY, sensing_mousey: this.getMouseY,
'sensing_mousedown': this.getMouseDown, sensing_mousedown: this.getMouseDown,
'sensing_keypressed': this.getKeyPressed, sensing_keypressed: this.getKeyPressed,
'sensing_current': this.current, sensing_current: this.current,
'sensing_dayssince2000': this.daysSince2000 sensing_dayssince2000: this.daysSince2000
}; };
}; };

View file

@ -10,14 +10,14 @@ var Keyboard = require('../io/keyboard');
var Mouse = require('../io/mouse'); var Mouse = require('../io/mouse');
var defaultBlockPackages = { var defaultBlockPackages = {
'scratch3_control': require('../blocks/scratch3_control'), scratch3_control: require('../blocks/scratch3_control'),
'scratch3_event': require('../blocks/scratch3_event'), scratch3_event: require('../blocks/scratch3_event'),
'scratch3_looks': require('../blocks/scratch3_looks'), scratch3_looks: require('../blocks/scratch3_looks'),
'scratch3_motion': require('../blocks/scratch3_motion'), scratch3_motion: require('../blocks/scratch3_motion'),
'scratch3_operators': require('../blocks/scratch3_operators'), scratch3_operators: require('../blocks/scratch3_operators'),
'scratch3_sensing': require('../blocks/scratch3_sensing'), scratch3_sensing: require('../blocks/scratch3_sensing'),
'scratch3_data': require('../blocks/scratch3_data'), scratch3_data: require('../blocks/scratch3_data'),
'scratch3_procedures': require('../blocks/scratch3_procedures') scratch3_procedures: require('../blocks/scratch3_procedures')
}; };
/** /**
@ -139,9 +139,9 @@ var Runtime = function () {
// I/O related data. // I/O related data.
/** @type {Object.<string, Object>} */ /** @type {Object.<string, Object>} */
this.ioDevices = { this.ioDevices = {
'clock': new Clock(), clock: new Clock(),
'keyboard': new Keyboard(this), keyboard: new Keyboard(this),
'mouse': new Mouse(this) mouse: new Mouse(this)
}; };
}; };

File diff suppressed because it is too large Load diff

View file

@ -311,7 +311,7 @@ VirtualMachine.prototype.emitTargetsUpdate = function () {
*/ */
VirtualMachine.prototype.emitWorkspaceUpdate = function () { VirtualMachine.prototype.emitWorkspaceUpdate = function () {
this.emit('workspaceUpdate', { this.emit('workspaceUpdate', {
'xml': this.editingTarget.blocks.toXML() xml: this.editingTarget.blocks.toXML()
}); });
}; };

View file

@ -62,10 +62,10 @@ Keyboard.prototype.postData = function (data) {
} }
// Always trigger hats, even if it was already pressed. // Always trigger hats, even if it was already pressed.
this.runtime.startHats('event_whenkeypressed', { this.runtime.startHats('event_whenkeypressed', {
'KEY_OPTION': this._keyCodeToScratchKey(data.keyCode) KEY_OPTION: this._keyCodeToScratchKey(data.keyCode)
}); });
this.runtime.startHats('event_whenkeypressed', { this.runtime.startHats('event_whenkeypressed', {
'KEY_OPTION': 'any' KEY_OPTION: 'any'
}); });
} else if (index > -1) { } else if (index > -1) {
// If already present, remove from the list. // If already present, remove from the list.

View file

@ -37,13 +37,13 @@ var Clone = function (sprite, runtime) {
* @type {!Object.<string, number>} * @type {!Object.<string, number>}
*/ */
this.effects = { this.effects = {
'color': 0, color: 0,
'fisheye': 0, fisheye: 0,
'whirl': 0, whirl: 0,
'pixelate': 0, pixelate: 0,
'mosaic': 0, mosaic: 0,
'brightness': 0, brightness: 0,
'ghost': 0 ghost: 0
}; };
}; };
util.inherits(Clone, Target); util.inherits(Clone, Target);

View file

@ -326,7 +326,7 @@ test('move no obscure shadow', function (t) {
next: null, next: null,
fields: {}, fields: {},
inputs: { inputs: {
'fooInput': { fooInput: {
name: 'fooInput', name: 'fooInput',
block: 'x', block: 'x',
shadow: 'y' shadow: 'y'

View file

@ -50,7 +50,7 @@ module.exports = [
// Webpack-compatible // Webpack-compatible
defaultsDeep({}, base, { defaultsDeep({}, base, {
entry: { entry: {
'dist': './src/index.js' dist: './src/index.js'
}, },
output: { output: {
@ -63,8 +63,8 @@ module.exports = [
// Playground // Playground
defaultsDeep({}, base, { defaultsDeep({}, base, {
entry: { entry: {
'vm': './src/index.js', vm: './src/index.js',
'vendor': [ vendor: [
// FPS counter // FPS counter
'stats.js/build/stats.min.js', 'stats.js/build/stats.min.js',
// Syntax highlighter // Syntax highlighter