mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-09 14:32:07 -05:00
fix code review comments
This commit is contained in:
parent
f214d3a191
commit
4a542b455d
3 changed files with 8 additions and 8 deletions
|
@ -313,7 +313,7 @@ class Scratch3SensingBlocks {
|
|||
}
|
||||
}
|
||||
|
||||
// Local variables (not lists).
|
||||
// Target variables.
|
||||
const varName = args.PROPERTY;
|
||||
const variable = attrTarget.lookupVariableByNameAndType(varName, '', true);
|
||||
if (variable) {
|
||||
|
|
|
@ -2181,7 +2181,7 @@ class Runtime extends EventEmitter {
|
|||
* Emit an event that indicate that the blocks on the workspace need updating.
|
||||
*/
|
||||
requestBlocksUpdate () {
|
||||
this.emit(Runtime.BLOCK_NEED_UPDATE);
|
||||
this.emit(Runtime.BLOCKS_NEED_UPDATE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -234,12 +234,12 @@ test('get attribute of sprite variable', t => {
|
|||
const sensing = new Sensing(rt);
|
||||
const s = new Sprite();
|
||||
const target = new RenderedTarget(s, rt);
|
||||
const thing = {
|
||||
const variable = {
|
||||
name: 'cars',
|
||||
value: 'trucks'
|
||||
};
|
||||
rt.getSpriteTargetByName = () => target;
|
||||
target.lookupVariableByNameAndType = () => thing;
|
||||
target.lookupVariableByNameAndType = () => variable;
|
||||
t.equal(sensing.getAttributeOf({PROPERTY: 'cars'}), 'trucks');
|
||||
|
||||
t.end();
|
||||
|
@ -248,10 +248,10 @@ test('get attribute of variable that does not exist', t => {
|
|||
const rt = new Runtime();
|
||||
const sensing = new Sensing(rt);
|
||||
const s = new Sprite();
|
||||
const stage = new RenderedTarget(s, rt);
|
||||
rt.getTargetForStage = () => stage;
|
||||
stage.lookupVariableByNameAndType = () => null;
|
||||
t.equal(sensing.getAttributeOf({PROPERTY: 'stage'}), 0);
|
||||
const target = new RenderedTarget(s, rt);
|
||||
rt.getTargetForStage = () => target;
|
||||
target.lookupVariableByNameAndType = () => null;
|
||||
t.equal(sensing.getAttributeOf({PROPERTY: 'variableThatDoesNotExist'}), 0);
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue