Fixed procedure renaming

This commit is contained in:
Nathan Dinsmore 2014-05-01 13:25:07 -04:00
parent 68f5d051cd
commit 45fb50a3bf
2 changed files with 4 additions and 4 deletions

View file

@ -563,7 +563,7 @@ public class BlockMenus implements DragClient {
if (block.nextBlock) block.nextBlock.allBlocksDo(function(b:Block):void {
if (b.op == Specs.GET_PARAM) b.parameterIndex = -1; // parameters may have changed; clear cached indices
});
for each (var caller:Block in app.runtime.allCallsOf(oldSpec)) {
for each (var caller:Block in app.runtime.allCallsOf(oldSpec, app.viewedObj())) {
var oldArgs:Array = caller.args;
caller.setSpec(newSpec, block.defaultArgValues);
for (var i:int = 0; i < oldArgs.length; i++) {

View file

@ -728,12 +728,12 @@ public class ScratchRuntime {
return result;
}
public function allCallsOf(callee:String):Array {
public function allCallsOf(callee:String, owner:ScratchObj):Array {
var result:Array = [];
for each (var stack:Block in allStacks()) {
for each (var stack:Block in owner.scripts) {
// for each block in stack
stack.allBlocksDo(function (b:Block):void {
if ((b.op == Specs.CALL) && (b.spec == callee)) result.push(b);
if (b.op == Specs.CALL && b.spec == callee) result.push(b);
});
}
return result;