mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-07 11:04:38 -04:00
Recompile
This commit is contained in:
parent
add3e9dec9
commit
20c75569c2
2 changed files with 9 additions and 15 deletions
16
vm.js
16
vm.js
|
@ -1201,12 +1201,6 @@
|
||||||
*/
|
*/
|
||||||
this.blocks = {};
|
this.blocks = {};
|
||||||
|
|
||||||
/**
|
|
||||||
* Primitive-accessible execution metadata for each block.
|
|
||||||
* @type {Object.<string, Object>}
|
|
||||||
*/
|
|
||||||
this.blockExecutionData = {};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All stacks in the workspace.
|
* All stacks in the workspace.
|
||||||
* A list of block IDs that represent stacks (first block in stack).
|
* A list of block IDs that represent stacks (first block in stack).
|
||||||
|
@ -1274,7 +1268,6 @@
|
||||||
Runtime.prototype.createBlock = function (block, opt_isFlyoutBlock) {
|
Runtime.prototype.createBlock = function (block, opt_isFlyoutBlock) {
|
||||||
// Create new block
|
// Create new block
|
||||||
this.blocks[block.id] = block;
|
this.blocks[block.id] = block;
|
||||||
this.blockExecutionData[block.id] = {};
|
|
||||||
|
|
||||||
// Walk each field and add any shadow blocks
|
// Walk each field and add any shadow blocks
|
||||||
// @todo Expand this to cover vertical / nested blocks
|
// @todo Expand this to cover vertical / nested blocks
|
||||||
|
@ -1283,7 +1276,6 @@
|
||||||
for (var y in shadows) {
|
for (var y in shadows) {
|
||||||
var shadow = shadows[y];
|
var shadow = shadows[y];
|
||||||
this.blocks[shadow.id] = shadow;
|
this.blocks[shadow.id] = shadow;
|
||||||
this.blockExecutionData[shadow.id] = {};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1380,7 +1372,6 @@
|
||||||
|
|
||||||
// Delete block
|
// Delete block
|
||||||
delete this.blocks[e.id];
|
delete this.blocks[e.id];
|
||||||
delete this.blockExecutionData[e.id];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
@ -1636,6 +1627,8 @@
|
||||||
if (activeThread.stack.length > 0
|
if (activeThread.stack.length > 0
|
||||||
&& activeThread.nextBlock === null) {
|
&& activeThread.nextBlock === null) {
|
||||||
activeThread.nextBlock = activeThread.stack.pop();
|
activeThread.nextBlock = activeThread.stack.pop();
|
||||||
|
// Don't pop stack frame - we need the data.
|
||||||
|
// A new one won't be created when we execute.
|
||||||
}
|
}
|
||||||
if (activeThread.nextBlock === null) {
|
if (activeThread.nextBlock === null) {
|
||||||
// No more on the stack
|
// No more on the stack
|
||||||
|
@ -1673,10 +1666,12 @@
|
||||||
|
|
||||||
// Push the current block to the stack
|
// Push the current block to the stack
|
||||||
thread.stack.push(currentBlock);
|
thread.stack.push(currentBlock);
|
||||||
// Push an empty stack frame, if we need one
|
// Push an empty stack frame, if we need one.
|
||||||
|
// Might not, if we just popped the stack.
|
||||||
if (thread.stack.length > thread.stackFrames.length) {
|
if (thread.stack.length > thread.stackFrames.length) {
|
||||||
thread.stackFrames.push({});
|
thread.stackFrames.push({});
|
||||||
}
|
}
|
||||||
|
var currentStackFrame = thread.stackFrames[thread.stackFrames.length - 1];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A callback for the primitive to indicate its thread should yield.
|
* A callback for the primitive to indicate its thread should yield.
|
||||||
|
@ -1720,7 +1715,6 @@
|
||||||
|
|
||||||
// @todo
|
// @todo
|
||||||
var argValues = [];
|
var argValues = [];
|
||||||
var currentStackFrame = thread.stackFrames[thread.stackFrames.length - 1];
|
|
||||||
|
|
||||||
if (!opcode) {
|
if (!opcode) {
|
||||||
console.warn('Could not get opcode for block: ' + currentBlock);
|
console.warn('Could not get opcode for block: ' + currentBlock);
|
||||||
|
|
8
vm.min.js
vendored
8
vm.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue