Skip to content

Commit 45fb50a

Browse files
committed
Fixed procedure renaming
1 parent 68f5d05 commit 45fb50a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/scratch/BlockMenus.as

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ public class BlockMenus implements DragClient {
563563
if (block.nextBlock) block.nextBlock.allBlocksDo(function(b:Block):void {
564564
if (b.op == Specs.GET_PARAM) b.parameterIndex = -1; // parameters may have changed; clear cached indices
565565
});
566-
for each (var caller:Block in app.runtime.allCallsOf(oldSpec)) {
566+
for each (var caller:Block in app.runtime.allCallsOf(oldSpec, app.viewedObj())) {
567567
var oldArgs:Array = caller.args;
568568
caller.setSpec(newSpec, block.defaultArgValues);
569569
for (var i:int = 0; i < oldArgs.length; i++) {

src/scratch/ScratchRuntime.as

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,12 +728,12 @@ public class ScratchRuntime {
728728
return result;
729729
}
730730

731-
public function allCallsOf(callee:String):Array {
731+
public function allCallsOf(callee:String, owner:ScratchObj):Array {
732732
var result:Array = [];
733-
for each (var stack:Block in allStacks()) {
733+
for each (var stack:Block in owner.scripts) {
734734
// for each block in stack
735735
stack.allBlocksDo(function (b:Block):void {
736-
if ((b.op == Specs.CALL) && (b.spec == callee)) result.push(b);
736+
if (b.op == Specs.CALL && b.spec == callee) result.push(b);
737737
});
738738
}
739739
return result;

0 commit comments

Comments
 (0)