mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-14 15:09:18 -04:00
Pulling in the latest changes from google/blockly/variables_by_id branch,
starting with commit 6218750 (December 19, 2017) through commit 80b397f (January 10, 2018).
This commit is contained in:
parent
ddf61c146b
commit
855ec2665a
15 changed files with 507 additions and 232 deletions
tests/jsunit
|
@ -140,14 +140,13 @@ function test_deleteVariable_InternalTrivial() {
|
|||
|
||||
function test_addTopBlock_TrivialFlyoutIsTrue() {
|
||||
workspaceTest_setUp();
|
||||
workspace.isFlyout = true;
|
||||
var targetWorkspace = new Blockly.Workspace();
|
||||
workspace.isFlyout = true;
|
||||
workspace.targetWorkspace = targetWorkspace;
|
||||
targetWorkspace.createVariable('name1', '', '1');
|
||||
|
||||
// Flyout.init usually does this binding.
|
||||
workspace.getVariableById =
|
||||
targetWorkspace.getVariableById.bind(targetWorkspace);
|
||||
workspace.variableMap_ = targetWorkspace.getVariableMap();
|
||||
|
||||
try {
|
||||
var block = createMockBlock('1');
|
||||
|
@ -155,8 +154,11 @@ function test_addTopBlock_TrivialFlyoutIsTrue() {
|
|||
workspace.addTopBlock(block);
|
||||
checkVariableValues(workspace, 'name1', '', '1');
|
||||
} finally {
|
||||
targetWorkspace.dispose();
|
||||
workspaceTest_tearDown();
|
||||
// Have to dispose of the main workspace after the flyout workspace, because
|
||||
// it holds the variable map.
|
||||
// Normally the main workspace disposes of the flyout workspace.
|
||||
targetWorkspace.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue