mirror of
https://github.com/scratchfoundation/scratch-flash.git
synced 2024-12-04 21:21:06 -05:00
Fixed procedure renaming
This commit is contained in:
parent
68f5d051cd
commit
45fb50a3bf
2 changed files with 4 additions and 4 deletions
|
@ -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++) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue