mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-29 07:40:26 -04:00
Remove dead code path from getCached
There was a code path that handled the case where getCached was not passed the `CacheType` parameter. However, all call sites *do* pass that parameter, and the JSDoc indicates that the parameter is required.
This commit is contained in:
parent
f38ee90a9d
commit
002cddf620
1 changed files with 7 additions and 17 deletions
|
@ -1234,23 +1234,13 @@ BlocksExecuteCache.getCached = function (blocks, blockId, CacheType) {
|
||||||
const block = blocks.getBlock(blockId);
|
const block = blocks.getBlock(blockId);
|
||||||
if (typeof block === 'undefined') return null;
|
if (typeof block === 'undefined') return null;
|
||||||
|
|
||||||
if (typeof CacheType === 'undefined') {
|
cached = new CacheType(blocks, {
|
||||||
cached = {
|
id: blockId,
|
||||||
id: blockId,
|
opcode: blocks.getOpcode(block),
|
||||||
opcode: blocks.getOpcode(block),
|
fields: blocks.getFields(block),
|
||||||
fields: blocks.getFields(block),
|
inputs: blocks.getInputs(block),
|
||||||
inputs: blocks.getInputs(block),
|
mutation: blocks.getMutation(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)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
blocks._cache._executeCached[blockId] = cached;
|
blocks._cache._executeCached[blockId] = cached;
|
||||||
return cached;
|
return cached;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue