mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-07 19:14:40 -04:00
Merge 002cddf620
into f207757ef0
This commit is contained in:
commit
ba4e22e04f
1 changed files with 7 additions and 17 deletions
|
@ -1431,23 +1431,13 @@ BlocksExecuteCache.getCached = function (blocks, blockId, CacheType) {
|
|||
const block = blocks.getBlock(blockId);
|
||||
if (typeof block === 'undefined') return null;
|
||||
|
||||
if (typeof CacheType === 'undefined') {
|
||||
cached = {
|
||||
id: blockId,
|
||||
opcode: blocks.getOpcode(block),
|
||||
fields: blocks.getFields(block),
|
||||
inputs: blocks.getInputs(block),
|
||||
mutation: blocks.getMutation(block)
|
||||
};
|
||||
} else {
|
||||
cached = new CacheType(blocks, {
|
||||
id: blockId,
|
||||
opcode: blocks.getOpcode(block),
|
||||
fields: blocks.getFields(block),
|
||||
inputs: blocks.getInputs(block),
|
||||
mutation: blocks.getMutation(block)
|
||||
});
|
||||
}
|
||||
cached = new CacheType(blocks, {
|
||||
id: blockId,
|
||||
opcode: blocks.getOpcode(block),
|
||||
fields: blocks.getFields(block),
|
||||
inputs: blocks.getInputs(block),
|
||||
mutation: blocks.getMutation(block)
|
||||
});
|
||||
|
||||
blocks._cache._executeCached[blockId] = cached;
|
||||
return cached;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue