kopia lustrzana https://github.com/backface/turtlestitch
some more arrow functions for byob.js
rodzic
2826f9e617
commit
7d6f43c4aa
12
src/byob.js
12
src/byob.js
|
|
@ -462,10 +462,8 @@ CustomBlockDefinition.prototype.localizedSpec = function () {
|
||||||
CustomBlockDefinition.prototype.abstractBlockSpec = function () {
|
CustomBlockDefinition.prototype.abstractBlockSpec = function () {
|
||||||
// answer the semantic block spec substituting each input
|
// answer the semantic block spec substituting each input
|
||||||
// with an underscore
|
// with an underscore
|
||||||
return BlockMorph.prototype.parseSpec(this.blockSpec()).map(
|
return BlockMorph.prototype.parseSpec(this.blockSpec()).map(str =>
|
||||||
function (str) {
|
(str.length > 1 && (str[0]) === '%') ? '_' : str
|
||||||
return (str.length > 1 && (str[0]) === '%') ? '_' : str;
|
|
||||||
}
|
|
||||||
).join(' ');
|
).join(' ');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -986,10 +984,8 @@ CustomCommandBlockMorph.prototype.isInUse = function () {
|
||||||
rcvr = this.scriptTarget(),
|
rcvr = this.scriptTarget(),
|
||||||
ide = rcvr.parentThatIsA(IDE_Morph);
|
ide = rcvr.parentThatIsA(IDE_Morph);
|
||||||
if (def.isGlobal && ide) {
|
if (def.isGlobal && ide) {
|
||||||
return ide.sprites.asArray().concat([ide.stage]).some(
|
return ide.sprites.asArray().concat([ide.stage]).some((any, idx) =>
|
||||||
function (any, idx) {
|
any.usesBlockInstance(def, false, idx)
|
||||||
return any.usesBlockInstance(def, false, idx);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return rcvr.allDependentInvocationsOf(this.blockSpec).length > 0;
|
return rcvr.allDependentInvocationsOf(this.blockSpec).length > 0;
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue