scratch-blocks 1.2.0-beta.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/commit-msg +3 -0
- package/blockly_compressed_horizontal.js +2255 -0
- package/blockly_compressed_vertical.js +2283 -0
- package/blockly_uncompressed_horizontal.js +1210 -0
- package/blockly_uncompressed_vertical.js +1210 -0
- package/blocks_common/colour.js +61 -0
- package/blocks_common/math.js +159 -0
- package/blocks_common/matrix.js +54 -0
- package/blocks_common/note.js +58 -0
- package/blocks_common/text.js +57 -0
- package/blocks_compressed.js +36 -0
- package/blocks_compressed_horizontal.js +67 -0
- package/blocks_compressed_vertical.js +208 -0
- package/blocks_horizontal/control.js +212 -0
- package/blocks_horizontal/default_toolbox.js +139 -0
- package/blocks_horizontal/event.js +190 -0
- package/blocks_horizontal/wedo.js +325 -0
- package/blocks_vertical/control.js +532 -0
- package/blocks_vertical/data.js +666 -0
- package/blocks_vertical/default_toolbox.js +564 -0
- package/blocks_vertical/event.js +329 -0
- package/blocks_vertical/extensions.js +294 -0
- package/blocks_vertical/looks.js +591 -0
- package/blocks_vertical/motion.js +587 -0
- package/blocks_vertical/operators.js +470 -0
- package/blocks_vertical/procedures.js +973 -0
- package/blocks_vertical/sensing.js +554 -0
- package/blocks_vertical/sound.js +246 -0
- package/blocks_vertical/vertical_extensions.js +266 -0
- package/build/gen_blocks.js +1 -0
- package/build/test_expect.js +1 -0
- package/build/test_input.js +1 -0
- package/build.py +636 -0
- package/cleanup.sh +101 -0
- package/core/block.js +1837 -0
- package/core/block_animations.js +107 -0
- package/core/block_drag_surface.js +299 -0
- package/core/block_dragger.js +421 -0
- package/core/block_events.js +531 -0
- package/core/block_render_svg_horizontal.js +890 -0
- package/core/block_render_svg_vertical.js +1732 -0
- package/core/block_svg.js +1316 -0
- package/core/blockly.js +622 -0
- package/core/blocks.js +37 -0
- package/core/bubble.js +664 -0
- package/core/bubble_dragger.js +285 -0
- package/core/colours.js +160 -0
- package/core/comment.js +293 -0
- package/core/comment_events.js +539 -0
- package/core/connection.js +766 -0
- package/core/connection_db.js +300 -0
- package/core/constants.js +387 -0
- package/core/contextmenu.js +519 -0
- package/core/css.js +1351 -0
- package/core/data_category.js +490 -0
- package/core/dragged_connection_manager.js +260 -0
- package/core/dropdowndiv.js +408 -0
- package/core/events.js +429 -0
- package/core/events_abstract.js +113 -0
- package/core/extensions.js +450 -0
- package/core/field.js +807 -0
- package/core/field_angle.js +398 -0
- package/core/field_checkbox.js +133 -0
- package/core/field_colour.js +253 -0
- package/core/field_colour_slider.js +387 -0
- package/core/field_date.js +353 -0
- package/core/field_dropdown.js +483 -0
- package/core/field_iconmenu.js +309 -0
- package/core/field_image.js +193 -0
- package/core/field_label.js +136 -0
- package/core/field_label_serializable.js +125 -0
- package/core/field_matrix.js +566 -0
- package/core/field_note.js +850 -0
- package/core/field_number.js +366 -0
- package/core/field_numberdropdown.js +77 -0
- package/core/field_textdropdown.js +164 -0
- package/core/field_textinput.js +675 -0
- package/core/field_textinput_removable.js +105 -0
- package/core/field_variable.js +385 -0
- package/core/field_variable_getter.js +185 -0
- package/core/field_vertical_separator.js +161 -0
- package/core/flyout_base.js +923 -0
- package/core/flyout_button.js +322 -0
- package/core/flyout_dragger.js +83 -0
- package/core/flyout_extension_category_header.js +159 -0
- package/core/flyout_horizontal.js +475 -0
- package/core/flyout_vertical.js +770 -0
- package/core/generator.js +426 -0
- package/core/gesture.js +1011 -0
- package/core/grid.js +227 -0
- package/core/icon.js +205 -0
- package/core/inject.js +491 -0
- package/core/input.js +285 -0
- package/core/insertion_marker_manager.js +678 -0
- package/core/msg.js +62 -0
- package/core/mutator.js +426 -0
- package/core/names.js +198 -0
- package/core/options.js +244 -0
- package/core/procedures.js +577 -0
- package/core/rendered_connection.js +417 -0
- package/core/scratch_block_comment.js +653 -0
- package/core/scratch_blocks_utils.js +244 -0
- package/core/scratch_bubble.js +696 -0
- package/core/scratch_events.js +131 -0
- package/core/scratch_msgs.js +85 -0
- package/core/scrollbar.js +875 -0
- package/core/toolbox.js +801 -0
- package/core/tooltip.js +337 -0
- package/core/touch.js +226 -0
- package/core/trashcan.js +343 -0
- package/core/ui_events.js +91 -0
- package/core/ui_menu_utils.js +68 -0
- package/core/utils.js +948 -0
- package/core/variable_events.js +259 -0
- package/core/variable_map.js +415 -0
- package/core/variable_model.js +116 -0
- package/core/variables.js +674 -0
- package/core/warning.js +199 -0
- package/core/widgetdiv.js +344 -0
- package/core/workspace.js +673 -0
- package/core/workspace_audio.js +170 -0
- package/core/workspace_comment.js +432 -0
- package/core/workspace_comment_render_svg.js +723 -0
- package/core/workspace_comment_svg.js +611 -0
- package/core/workspace_drag_surface_svg.js +195 -0
- package/core/workspace_dragger.js +132 -0
- package/core/workspace_svg.js +2267 -0
- package/core/xml.js +919 -0
- package/core/zoom_controls.js +301 -0
- package/dist/horizontal.js +222 -0
- package/dist/vertical.js +222 -0
- package/dist/web/horizontal.js +232 -0
- package/dist/web/vertical.js +232 -0
- package/local_build.sh +70 -0
- package/msg/js/en.js +1 -0
- package/msg/json/en.json +1 -0
- package/msg/messages.js +1 -0
- package/msg/scratch_msgs.js +244 -184
- package/package.json +40 -25
- package/pull_from_blockly.sh +151 -0
- package/release.config.js +0 -8
- package/shim/blockly_compressed_horizontal-blocks_compressed.js +1 -0
- package/shim/blockly_compressed_horizontal.Blockly.js +1 -0
- package/shim/blockly_compressed_horizontal.goog.js +1 -0
- package/shim/blockly_compressed_horizontal.js +1 -0
- package/shim/blockly_compressed_vertical-blocks_compressed.js +1 -0
- package/shim/blockly_compressed_vertical.Blockly.js +1 -0
- package/shim/blockly_compressed_vertical.goog.js +1 -0
- package/shim/blockly_compressed_vertical.js +1 -0
- package/shim/blocks_compressed_horizontal-blockly_compressed_horizontal-messages.js +1 -0
- package/shim/blocks_compressed_horizontal.js +1 -0
- package/shim/blocks_compressed_vertical-blockly_compressed_vertical-messages.js +1 -0
- package/shim/blocks_compressed_vertical.js +1 -0
- package/shim/gh-pages.js +1 -0
- package/shim/horizontal.js +1 -0
- package/shim/index.js +17 -0
- package/shim/vertical.js +1 -0
- package/CHANGELOG.md +0 -1104
- package/TODO.md +0 -16
- package/blockly-rc/.eslintignore +0 -28
- package/blockly-rc/.eslintrc.js +0 -187
- package/blockly-rc/.gitattributes +0 -1
- package/blockly-rc/.github/CODEOWNERS +0 -1
- package/blockly-rc/.github/CONTRIBUTING.md +0 -46
- package/blockly-rc/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -58
- package/blockly-rc/.github/ISSUE_TEMPLATE/config.yml +0 -7
- package/blockly-rc/.github/ISSUE_TEMPLATE/documentation.yaml +0 -38
- package/blockly-rc/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -39
- package/blockly-rc/.github/PULL_REQUEST_TEMPLATE.md +0 -42
- package/blockly-rc/.github/dependabot.yml +0 -27
- package/blockly-rc/.github/release.yml +0 -32
- package/blockly-rc/.github/workflows/appengine_deploy.yml +0 -54
- package/blockly-rc/.github/workflows/assign_reviewers.yml +0 -41
- package/blockly-rc/.github/workflows/browser_test.yml +0 -55
- package/blockly-rc/.github/workflows/build.yml +0 -86
- package/blockly-rc/.github/workflows/conventional-label.yml +0 -17
- package/blockly-rc/.github/workflows/develop_freeze.yml +0 -26
- package/blockly-rc/.github/workflows/tag_module_cleanup.yml +0 -37
- package/blockly-rc/.github/workflows/welcome_new_contributors.yml +0 -36
- package/blockly-rc/.prettierignore +0 -30
- package/blockly-rc/.prettierrc.js +0 -13
- package/blockly-rc/CHANGELOG.md +0 -77
- package/blockly-rc/LICENSE +0 -202
- package/blockly-rc/README.md +0 -80
- package/blockly-rc/_config.yml +0 -1
- package/blockly-rc/api-extractor.json +0 -385
- package/blockly-rc/appengine/.gcloudignore +0 -20
- package/blockly-rc/appengine/README.txt +0 -42
- package/blockly-rc/appengine/add_timestamps.py +0 -69
- package/blockly-rc/appengine/app.yaml +0 -104
- package/blockly-rc/appengine/apple-touch-icon.png +0 -0
- package/blockly-rc/appengine/blockly_compressed.js +0 -11
- package/blockly-rc/appengine/expiration.py +0 -52
- package/blockly-rc/appengine/favicon.ico +0 -0
- package/blockly-rc/appengine/index.yaml +0 -11
- package/blockly-rc/appengine/main.py +0 -39
- package/blockly-rc/appengine/redirect.html +0 -107
- package/blockly-rc/appengine/requirements.txt +0 -1
- package/blockly-rc/appengine/robots.txt +0 -2
- package/blockly-rc/appengine/storage.js +0 -190
- package/blockly-rc/appengine/storage.py +0 -125
- package/blockly-rc/blocks/blocks.ts +0 -44
- package/blockly-rc/blocks/lists.ts +0 -1085
- package/blockly-rc/blocks/logic.ts +0 -712
- package/blockly-rc/blocks/loops.ts +0 -408
- package/blockly-rc/blocks/math.ts +0 -591
- package/blockly-rc/blocks/procedures.ts +0 -1364
- package/blockly-rc/blocks/text.ts +0 -1007
- package/blockly-rc/blocks/variables.ts +0 -183
- package/blockly-rc/blocks/variables_dynamic.ts +0 -194
- package/blockly-rc/core/any_aliases.ts +0 -8
- package/blockly-rc/core/block.ts +0 -2523
- package/blockly-rc/core/block_animations.ts +0 -225
- package/blockly-rc/core/block_flyout_inflater.ts +0 -262
- package/blockly-rc/core/block_svg.ts +0 -1768
- package/blockly-rc/core/blockly.ts +0 -605
- package/blockly-rc/core/blockly_options.ts +0 -71
- package/blockly-rc/core/blocks.ts +0 -18
- package/blockly-rc/core/browser_events.ts +0 -244
- package/blockly-rc/core/bubbles/bubble.ts +0 -658
- package/blockly-rc/core/bubbles/mini_workspace_bubble.ts +0 -280
- package/blockly-rc/core/bubbles/text_bubble.ts +0 -103
- package/blockly-rc/core/bubbles/textinput_bubble.ts +0 -344
- package/blockly-rc/core/bubbles.ts +0 -12
- package/blockly-rc/core/bump_objects.ts +0 -192
- package/blockly-rc/core/button_flyout_inflater.ts +0 -63
- package/blockly-rc/core/clipboard/block_paster.ts +0 -142
- package/blockly-rc/core/clipboard/registry.ts +0 -31
- package/blockly-rc/core/clipboard/workspace_comment_paster.ts +0 -94
- package/blockly-rc/core/clipboard.ts +0 -113
- package/blockly-rc/core/comments/comment_view.ts +0 -899
- package/blockly-rc/core/comments/rendered_workspace_comment.ts +0 -297
- package/blockly-rc/core/comments/workspace_comment.ts +0 -237
- package/blockly-rc/core/comments.ts +0 -9
- package/blockly-rc/core/common.ts +0 -305
- package/blockly-rc/core/component_manager.ts +0 -235
- package/blockly-rc/core/config.ts +0 -65
- package/blockly-rc/core/connection.ts +0 -793
- package/blockly-rc/core/connection_checker.ts +0 -348
- package/blockly-rc/core/connection_db.ts +0 -297
- package/blockly-rc/core/connection_type.ts +0 -21
- package/blockly-rc/core/constants.ts +0 -23
- package/blockly-rc/core/contextmenu.ts +0 -268
- package/blockly-rc/core/contextmenu_items.ts +0 -700
- package/blockly-rc/core/contextmenu_registry.ts +0 -194
- package/blockly-rc/core/css.ts +0 -481
- package/blockly-rc/core/delete_area.ts +0 -77
- package/blockly-rc/core/dialog.ts +0 -121
- package/blockly-rc/core/drag_target.ts +0 -97
- package/blockly-rc/core/dragging/block_drag_strategy.ts +0 -454
- package/blockly-rc/core/dragging/bubble_drag_strategy.ts +0 -52
- package/blockly-rc/core/dragging/comment_drag_strategy.ts +0 -91
- package/blockly-rc/core/dragging/dragger.ts +0 -163
- package/blockly-rc/core/dragging.ts +0 -12
- package/blockly-rc/core/dropdowndiv.ts +0 -768
- package/blockly-rc/core/events/events.ts +0 -163
- package/blockly-rc/core/events/events_abstract.ts +0 -130
- package/blockly-rc/core/events/events_block_base.ts +0 -88
- package/blockly-rc/core/events/events_block_change.ts +0 -259
- package/blockly-rc/core/events/events_block_create.ts +0 -185
- package/blockly-rc/core/events/events_block_delete.ts +0 -182
- package/blockly-rc/core/events/events_block_drag.ts +0 -116
- package/blockly-rc/core/events/events_block_field_intermediate_change.ts +0 -167
- package/blockly-rc/core/events/events_block_move.ts +0 -307
- package/blockly-rc/core/events/events_bubble_open.ts +0 -120
- package/blockly-rc/core/events/events_click.ts +0 -110
- package/blockly-rc/core/events/events_comment_base.ts +0 -126
- package/blockly-rc/core/events/events_comment_change.ts +0 -161
- package/blockly-rc/core/events/events_comment_collapse.ts +0 -103
- package/blockly-rc/core/events/events_comment_create.ts +0 -118
- package/blockly-rc/core/events/events_comment_delete.ts +0 -117
- package/blockly-rc/core/events/events_comment_drag.ts +0 -99
- package/blockly-rc/core/events/events_comment_move.ts +0 -207
- package/blockly-rc/core/events/events_comment_resize.ts +0 -174
- package/blockly-rc/core/events/events_marker_move.ts +0 -134
- package/blockly-rc/core/events/events_selected.ts +0 -98
- package/blockly-rc/core/events/events_theme_change.ts +0 -84
- package/blockly-rc/core/events/events_toolbox_item_select.ts +0 -96
- package/blockly-rc/core/events/events_trashcan_open.ts +0 -88
- package/blockly-rc/core/events/events_ui_base.ts +0 -47
- package/blockly-rc/core/events/events_var_base.ts +0 -89
- package/blockly-rc/core/events/events_var_create.ts +0 -129
- package/blockly-rc/core/events/events_var_delete.ts +0 -124
- package/blockly-rc/core/events/events_var_rename.ts +0 -133
- package/blockly-rc/core/events/events_var_type_change.ts +0 -122
- package/blockly-rc/core/events/events_viewport.ts +0 -149
- package/blockly-rc/core/events/utils.ts +0 -595
- package/blockly-rc/core/events/workspace_events.ts +0 -46
- package/blockly-rc/core/extensions.ts +0 -491
- package/blockly-rc/core/field.ts +0 -1471
- package/blockly-rc/core/field_checkbox.ts +0 -271
- package/blockly-rc/core/field_dropdown.ts +0 -857
- package/blockly-rc/core/field_image.ts +0 -297
- package/blockly-rc/core/field_input.ts +0 -755
- package/blockly-rc/core/field_label.ts +0 -150
- package/blockly-rc/core/field_label_serializable.ts +0 -73
- package/blockly-rc/core/field_number.ts +0 -381
- package/blockly-rc/core/field_registry.ts +0 -115
- package/blockly-rc/core/field_textinput.ts +0 -117
- package/blockly-rc/core/field_variable.ts +0 -651
- package/blockly-rc/core/flyout_base.ts +0 -968
- package/blockly-rc/core/flyout_button.ts +0 -416
- package/blockly-rc/core/flyout_horizontal.ts +0 -374
- package/blockly-rc/core/flyout_metrics_manager.ts +0 -90
- package/blockly-rc/core/flyout_separator.ts +0 -61
- package/blockly-rc/core/flyout_vertical.ts +0 -353
- package/blockly-rc/core/generator.ts +0 -611
- package/blockly-rc/core/gesture.ts +0 -1191
- package/blockly-rc/core/grid.ts +0 -252
- package/blockly-rc/core/icons/comment_icon.ts +0 -435
- package/blockly-rc/core/icons/exceptions.ts +0 -23
- package/blockly-rc/core/icons/icon.ts +0 -147
- package/blockly-rc/core/icons/icon_types.ts +0 -32
- package/blockly-rc/core/icons/mutator_icon.ts +0 -354
- package/blockly-rc/core/icons/registry.ts +0 -33
- package/blockly-rc/core/icons/warning_icon.ts +0 -219
- package/blockly-rc/core/icons.ts +0 -24
- package/blockly-rc/core/inject.ts +0 -428
- package/blockly-rc/core/inputs/align.ts +0 -14
- package/blockly-rc/core/inputs/dummy_input.ts +0 -26
- package/blockly-rc/core/inputs/end_row_input.ts +0 -31
- package/blockly-rc/core/inputs/input.ts +0 -318
- package/blockly-rc/core/inputs/input_types.ts +0 -27
- package/blockly-rc/core/inputs/statement_input.ts +0 -34
- package/blockly-rc/core/inputs/value_input.ts +0 -30
- package/blockly-rc/core/inputs.ts +0 -23
- package/blockly-rc/core/insertion_marker_manager.ts +0 -742
- package/blockly-rc/core/insertion_marker_previewer.ts +0 -254
- package/blockly-rc/core/interfaces/i_ast_node_location.ts +0 -12
- package/blockly-rc/core/interfaces/i_ast_node_location_svg.ts +0 -28
- package/blockly-rc/core/interfaces/i_ast_node_location_with_block.ts +0 -22
- package/blockly-rc/core/interfaces/i_autohideable.ts +0 -22
- package/blockly-rc/core/interfaces/i_bounded_element.ts +0 -30
- package/blockly-rc/core/interfaces/i_bubble.ts +0 -63
- package/blockly-rc/core/interfaces/i_collapsible_toolbox_item.ts +0 -33
- package/blockly-rc/core/interfaces/i_comment_icon.ts +0 -47
- package/blockly-rc/core/interfaces/i_component.ts +0 -19
- package/blockly-rc/core/interfaces/i_connection_checker.ts +0 -100
- package/blockly-rc/core/interfaces/i_connection_previewer.ts +0 -50
- package/blockly-rc/core/interfaces/i_contextmenu.ts +0 -16
- package/blockly-rc/core/interfaces/i_copyable.ts +0 -31
- package/blockly-rc/core/interfaces/i_deletable.ts +0 -34
- package/blockly-rc/core/interfaces/i_delete_area.ts +0 -28
- package/blockly-rc/core/interfaces/i_drag_target.ts +0 -69
- package/blockly-rc/core/interfaces/i_draggable.ts +0 -72
- package/blockly-rc/core/interfaces/i_dragger.ts +0 -35
- package/blockly-rc/core/interfaces/i_flyout.ts +0 -189
- package/blockly-rc/core/interfaces/i_flyout_inflater.ts +0 -41
- package/blockly-rc/core/interfaces/i_has_bubble.ts +0 -20
- package/blockly-rc/core/interfaces/i_icon.ts +0 -114
- package/blockly-rc/core/interfaces/i_keyboard_accessible.ts +0 -21
- package/blockly-rc/core/interfaces/i_legacy_procedure_blocks.ts +0 -50
- package/blockly-rc/core/interfaces/i_metrics_manager.ts +0 -149
- package/blockly-rc/core/interfaces/i_movable.ts +0 -19
- package/blockly-rc/core/interfaces/i_observable.ts +0 -24
- package/blockly-rc/core/interfaces/i_parameter_model.ts +0 -51
- package/blockly-rc/core/interfaces/i_paster.ts +0 -25
- package/blockly-rc/core/interfaces/i_positionable.ts +0 -33
- package/blockly-rc/core/interfaces/i_procedure_block.ts +0 -27
- package/blockly-rc/core/interfaces/i_procedure_map.ts +0 -18
- package/blockly-rc/core/interfaces/i_procedure_model.ts +0 -71
- package/blockly-rc/core/interfaces/i_registrable.ts +0 -12
- package/blockly-rc/core/interfaces/i_rendered_element.ts +0 -22
- package/blockly-rc/core/interfaces/i_selectable.ts +0 -34
- package/blockly-rc/core/interfaces/i_selectable_toolbox_item.ts +0 -63
- package/blockly-rc/core/interfaces/i_serializable.ts +0 -28
- package/blockly-rc/core/interfaces/i_serializer.ts +0 -55
- package/blockly-rc/core/interfaces/i_styleable.ts +0 -26
- package/blockly-rc/core/interfaces/i_toolbox.ts +0 -112
- package/blockly-rc/core/interfaces/i_toolbox_item.ts +0 -81
- package/blockly-rc/core/interfaces/i_variable_backed_parameter_model.ts +0 -23
- package/blockly-rc/core/interfaces/i_variable_map.ts +0 -65
- package/blockly-rc/core/interfaces/i_variable_model.ts +0 -57
- package/blockly-rc/core/internal_constants.ts +0 -47
- package/blockly-rc/core/keyboard_nav/ast_node.ts +0 -884
- package/blockly-rc/core/keyboard_nav/basic_cursor.ts +0 -223
- package/blockly-rc/core/keyboard_nav/cursor.ts +0 -138
- package/blockly-rc/core/keyboard_nav/marker.ts +0 -113
- package/blockly-rc/core/keyboard_nav/tab_navigate_cursor.ts +0 -46
- package/blockly-rc/core/label_flyout_inflater.ts +0 -59
- package/blockly-rc/core/layer_manager.ts +0 -186
- package/blockly-rc/core/layers.ts +0 -17
- package/blockly-rc/core/main.ts +0 -31
- package/blockly-rc/core/marker_manager.ts +0 -189
- package/blockly-rc/core/menu.ts +0 -463
- package/blockly-rc/core/menuitem.ts +0 -221
- package/blockly-rc/core/metrics_manager.ts +0 -486
- package/blockly-rc/core/msg.ts +0 -27
- package/blockly-rc/core/names.ts +0 -275
- package/blockly-rc/core/observable_procedure_map.ts +0 -66
- package/blockly-rc/core/options.ts +0 -377
- package/blockly-rc/core/positionable_helpers.ts +0 -186
- package/blockly-rc/core/procedures.ts +0 -510
- package/blockly-rc/core/registry.ts +0 -400
- package/blockly-rc/core/render_management.ts +0 -193
- package/blockly-rc/core/rendered_connection.ts +0 -571
- package/blockly-rc/core/renderers/common/block_rendering.ts +0 -120
- package/blockly-rc/core/renderers/common/constants.ts +0 -1198
- package/blockly-rc/core/renderers/common/drawer.ts +0 -518
- package/blockly-rc/core/renderers/common/i_path_object.ts +0 -137
- package/blockly-rc/core/renderers/common/info.ts +0 -767
- package/blockly-rc/core/renderers/common/marker_svg.ts +0 -765
- package/blockly-rc/core/renderers/common/path_object.ts +0 -324
- package/blockly-rc/core/renderers/common/renderer.ts +0 -281
- package/blockly-rc/core/renderers/geras/constants.ts +0 -46
- package/blockly-rc/core/renderers/geras/drawer.ts +0 -167
- package/blockly-rc/core/renderers/geras/geras.ts +0 -31
- package/blockly-rc/core/renderers/geras/highlight_constants.ts +0 -342
- package/blockly-rc/core/renderers/geras/highlighter.ts +0 -313
- package/blockly-rc/core/renderers/geras/info.ts +0 -478
- package/blockly-rc/core/renderers/geras/measurables/inline_input.ts +0 -37
- package/blockly-rc/core/renderers/geras/measurables/statement_input.ts +0 -36
- package/blockly-rc/core/renderers/geras/path_object.ts +0 -135
- package/blockly-rc/core/renderers/geras/renderer.ts +0 -124
- package/blockly-rc/core/renderers/measurables/base.ts +0 -41
- package/blockly-rc/core/renderers/measurables/bottom_row.ts +0 -104
- package/blockly-rc/core/renderers/measurables/connection.ts +0 -43
- package/blockly-rc/core/renderers/measurables/external_value_input.ts +0 -53
- package/blockly-rc/core/renderers/measurables/field.ts +0 -50
- package/blockly-rc/core/renderers/measurables/hat.ts +0 -33
- package/blockly-rc/core/renderers/measurables/icon.ts +0 -42
- package/blockly-rc/core/renderers/measurables/in_row_spacer.ts +0 -29
- package/blockly-rc/core/renderers/measurables/inline_input.ts +0 -63
- package/blockly-rc/core/renderers/measurables/input_connection.ts +0 -57
- package/blockly-rc/core/renderers/measurables/input_row.ts +0 -67
- package/blockly-rc/core/renderers/measurables/jagged_edge.ts +0 -28
- package/blockly-rc/core/renderers/measurables/next_connection.ts +0 -34
- package/blockly-rc/core/renderers/measurables/output_connection.ts +0 -43
- package/blockly-rc/core/renderers/measurables/previous_connection.ts +0 -34
- package/blockly-rc/core/renderers/measurables/round_corner.ts +0 -34
- package/blockly-rc/core/renderers/measurables/row.ts +0 -191
- package/blockly-rc/core/renderers/measurables/spacer_row.ts +0 -44
- package/blockly-rc/core/renderers/measurables/square_corner.ts +0 -32
- package/blockly-rc/core/renderers/measurables/statement_input.ts +0 -41
- package/blockly-rc/core/renderers/measurables/top_row.ts +0 -110
- package/blockly-rc/core/renderers/measurables/types.ts +0 -319
- package/blockly-rc/core/renderers/thrasos/info.ts +0 -328
- package/blockly-rc/core/renderers/thrasos/renderer.ts +0 -40
- package/blockly-rc/core/renderers/thrasos/thrasos.ts +0 -14
- package/blockly-rc/core/renderers/zelos/constants.ts +0 -877
- package/blockly-rc/core/renderers/zelos/drawer.ts +0 -274
- package/blockly-rc/core/renderers/zelos/info.ts +0 -652
- package/blockly-rc/core/renderers/zelos/marker_svg.ts +0 -145
- package/blockly-rc/core/renderers/zelos/measurables/bottom_row.ts +0 -44
- package/blockly-rc/core/renderers/zelos/measurables/inputs.ts +0 -41
- package/blockly-rc/core/renderers/zelos/measurables/row_elements.ts +0 -29
- package/blockly-rc/core/renderers/zelos/measurables/top_row.ts +0 -50
- package/blockly-rc/core/renderers/zelos/path_object.ts +0 -209
- package/blockly-rc/core/renderers/zelos/renderer.ts +0 -143
- package/blockly-rc/core/renderers/zelos/zelos.ts +0 -33
- package/blockly-rc/core/scrollbar.ts +0 -898
- package/blockly-rc/core/scrollbar_pair.ts +0 -349
- package/blockly-rc/core/separator_flyout_inflater.ts +0 -69
- package/blockly-rc/core/serialization/blocks.ts +0 -868
- package/blockly-rc/core/serialization/exceptions.ts +0 -112
- package/blockly-rc/core/serialization/priorities.ts +0 -25
- package/blockly-rc/core/serialization/procedures.ts +0 -158
- package/blockly-rc/core/serialization/registry.ts +0 -30
- package/blockly-rc/core/serialization/variables.ts +0 -68
- package/blockly-rc/core/serialization/workspace_comments.ts +0 -143
- package/blockly-rc/core/serialization/workspaces.ts +0 -94
- package/blockly-rc/core/serialization.ts +0 -32
- package/blockly-rc/core/shortcut_items.ts +0 -338
- package/blockly-rc/core/shortcut_registry.ts +0 -368
- package/blockly-rc/core/sprites.ts +0 -15
- package/blockly-rc/core/theme/classic.ts +0 -40
- package/blockly-rc/core/theme/themes.ts +0 -12
- package/blockly-rc/core/theme/zelos.ts +0 -80
- package/blockly-rc/core/theme.ts +0 -232
- package/blockly-rc/core/theme_manager.ts +0 -192
- package/blockly-rc/core/toolbox/category.ts +0 -739
- package/blockly-rc/core/toolbox/collapsible_category.ts +0 -288
- package/blockly-rc/core/toolbox/separator.ts +0 -105
- package/blockly-rc/core/toolbox/toolbox.ts +0 -1134
- package/blockly-rc/core/toolbox/toolbox_item.ts +0 -152
- package/blockly-rc/core/tooltip.ts +0 -466
- package/blockly-rc/core/touch.ts +0 -155
- package/blockly-rc/core/trashcan.ts +0 -748
- package/blockly-rc/core/utils/aria.ts +0 -144
- package/blockly-rc/core/utils/array.ts +0 -24
- package/blockly-rc/core/utils/colour.ts +0 -265
- package/blockly-rc/core/utils/coordinate.ts +0 -129
- package/blockly-rc/core/utils/deprecation.ts +0 -47
- package/blockly-rc/core/utils/dom.ts +0 -356
- package/blockly-rc/core/utils/idgenerator.ts +0 -70
- package/blockly-rc/core/utils/keycodes.ts +0 -154
- package/blockly-rc/core/utils/math.ts +0 -50
- package/blockly-rc/core/utils/metrics.ts +0 -86
- package/blockly-rc/core/utils/object.ts +0 -28
- package/blockly-rc/core/utils/parsing.ts +0 -287
- package/blockly-rc/core/utils/rect.ts +0 -69
- package/blockly-rc/core/utils/size.ts +0 -62
- package/blockly-rc/core/utils/string.ts +0 -289
- package/blockly-rc/core/utils/style.ts +0 -219
- package/blockly-rc/core/utils/svg.ts +0 -84
- package/blockly-rc/core/utils/svg_math.ts +0 -208
- package/blockly-rc/core/utils/svg_paths.ts +0 -133
- package/blockly-rc/core/utils/toolbox.ts +0 -419
- package/blockly-rc/core/utils/useragent.ts +0 -86
- package/blockly-rc/core/utils/xml.ts +0 -165
- package/blockly-rc/core/utils.ts +0 -59
- package/blockly-rc/core/variable_map.ts +0 -437
- package/blockly-rc/core/variable_model.ts +0 -149
- package/blockly-rc/core/variables.ts +0 -773
- package/blockly-rc/core/variables_dynamic.ts +0 -142
- package/blockly-rc/core/widgetdiv.ts +0 -319
- package/blockly-rc/core/workspace.ts +0 -957
- package/blockly-rc/core/workspace_audio.ts +0 -171
- package/blockly-rc/core/workspace_dragger.ts +0 -97
- package/blockly-rc/core/workspace_svg.ts +0 -2519
- package/blockly-rc/core/xml.ts +0 -1133
- package/blockly-rc/core/zoom_controls.ts +0 -492
- package/blockly-rc/demos/blockfactory/analytics.js +0 -195
- package/blockly-rc/demos/blockfactory/app_controller.js +0 -726
- package/blockly-rc/demos/blockfactory/block_definition_extractor.js +0 -742
- package/blockly-rc/demos/blockfactory/block_exporter_controller.js +0 -311
- package/blockly-rc/demos/blockfactory/block_exporter_tools.js +0 -212
- package/blockly-rc/demos/blockfactory/block_exporter_view.js +0 -101
- package/blockly-rc/demos/blockfactory/block_library_controller.js +0 -325
- package/blockly-rc/demos/blockfactory/block_library_storage.js +0 -149
- package/blockly-rc/demos/blockfactory/block_library_view.js +0 -178
- package/blockly-rc/demos/blockfactory/block_option.js +0 -151
- package/blockly-rc/demos/blockfactory/blocks.js +0 -916
- package/blockly-rc/demos/blockfactory/cp.css +0 -46
- package/blockly-rc/demos/blockfactory/cp.js +0 -179
- package/blockly-rc/demos/blockfactory/factory.css +0 -586
- package/blockly-rc/demos/blockfactory/factory.js +0 -337
- package/blockly-rc/demos/blockfactory/factory_utils.js +0 -1036
- package/blockly-rc/demos/blockfactory/icon.png +0 -0
- package/blockly-rc/demos/blockfactory/index.html +0 -767
- package/blockly-rc/demos/blockfactory/link.png +0 -0
- package/blockly-rc/demos/blockfactory/standard_categories.js +0 -384
- package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_controller.js +0 -1332
- package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_generator.js +0 -224
- package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_init.js +0 -541
- package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_model.js +0 -548
- package/blockly-rc/demos/blockfactory/workspacefactory/wfactory_view.js +0 -424
- package/blockly-rc/demos/code/code.js +0 -626
- package/blockly-rc/demos/code/icon.png +0 -0
- package/blockly-rc/demos/code/icons.png +0 -0
- package/blockly-rc/demos/code/index.html +0 -359
- package/blockly-rc/demos/code/msg/ar.js +0 -24
- package/blockly-rc/demos/code/msg/be-tarask.js +0 -24
- package/blockly-rc/demos/code/msg/br.js +0 -24
- package/blockly-rc/demos/code/msg/ca.js +0 -24
- package/blockly-rc/demos/code/msg/cs.js +0 -24
- package/blockly-rc/demos/code/msg/da.js +0 -24
- package/blockly-rc/demos/code/msg/de.js +0 -24
- package/blockly-rc/demos/code/msg/el.js +0 -24
- package/blockly-rc/demos/code/msg/en.js +0 -24
- package/blockly-rc/demos/code/msg/es.js +0 -24
- package/blockly-rc/demos/code/msg/et.js +0 -24
- package/blockly-rc/demos/code/msg/fa.js +0 -24
- package/blockly-rc/demos/code/msg/fr.js +0 -24
- package/blockly-rc/demos/code/msg/he.js +0 -24
- package/blockly-rc/demos/code/msg/hr.js +0 -24
- package/blockly-rc/demos/code/msg/hrx.js +0 -24
- package/blockly-rc/demos/code/msg/hu.js +0 -24
- package/blockly-rc/demos/code/msg/ia.js +0 -24
- package/blockly-rc/demos/code/msg/is.js +0 -24
- package/blockly-rc/demos/code/msg/it.js +0 -24
- package/blockly-rc/demos/code/msg/ja.js +0 -24
- package/blockly-rc/demos/code/msg/kab.js +0 -24
- package/blockly-rc/demos/code/msg/ko.js +0 -24
- package/blockly-rc/demos/code/msg/mk.js +0 -24
- package/blockly-rc/demos/code/msg/ms.js +0 -24
- package/blockly-rc/demos/code/msg/nb.js +0 -24
- package/blockly-rc/demos/code/msg/nl.js +0 -24
- package/blockly-rc/demos/code/msg/oc.js +0 -24
- package/blockly-rc/demos/code/msg/pl.js +0 -24
- package/blockly-rc/demos/code/msg/pms.js +0 -24
- package/blockly-rc/demos/code/msg/pt-br.js +0 -24
- package/blockly-rc/demos/code/msg/ro.js +0 -24
- package/blockly-rc/demos/code/msg/ru.js +0 -24
- package/blockly-rc/demos/code/msg/sc.js +0 -24
- package/blockly-rc/demos/code/msg/sk.js +0 -24
- package/blockly-rc/demos/code/msg/sr.js +0 -24
- package/blockly-rc/demos/code/msg/sv.js +0 -24
- package/blockly-rc/demos/code/msg/ta.js +0 -24
- package/blockly-rc/demos/code/msg/th.js +0 -24
- package/blockly-rc/demos/code/msg/tlh.js +0 -24
- package/blockly-rc/demos/code/msg/tr.js +0 -24
- package/blockly-rc/demos/code/msg/uk.js +0 -24
- package/blockly-rc/demos/code/msg/vi.js +0 -24
- package/blockly-rc/demos/code/msg/zh-hans.js +0 -24
- package/blockly-rc/demos/code/msg/zh-hant.js +0 -24
- package/blockly-rc/demos/code/style.css +0 -184
- package/blockly-rc/demos/index.html +0 -68
- package/blockly-rc/demos/minimap/icon.png +0 -0
- package/blockly-rc/demos/minimap/index.html +0 -91
- package/blockly-rc/demos/minimap/minimap.js +0 -302
- package/blockly-rc/demos/mobile/README.md +0 -53
- package/blockly-rc/demos/mobile/android/README.md +0 -45
- package/blockly-rc/demos/mobile/android/app/build.gradle +0 -64
- package/blockly-rc/demos/mobile/android/app/proguard-rules.pro +0 -21
- package/blockly-rc/demos/mobile/android/app/src/androidTest/java/com/example/blocklywebview/ExampleInstrumentedTest.java +0 -26
- package/blockly-rc/demos/mobile/android/app/src/main/AndroidManifest.xml +0 -21
- package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/BlocklyWebViewFragment.java +0 -40
- package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/JsDialogHelper.java +0 -150
- package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/WebChromeClient.java +0 -32
- package/blockly-rc/demos/mobile/android/app/src/main/java/com/google/blockly/android/webview/demo/MainActivity.java +0 -18
- package/blockly-rc/demos/mobile/android/app/src/main/res/drawable/ic_launcher_background.xml +0 -74
- package/blockly-rc/demos/mobile/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +0 -34
- package/blockly-rc/demos/mobile/android/app/src/main/res/layout/activity_main.xml +0 -17
- package/blockly-rc/demos/mobile/android/app/src/main/res/layout/js_prompt.xml +0 -37
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/blockly-rc/demos/mobile/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/blockly-rc/demos/mobile/android/app/src/main/res/values/colors.xml +0 -6
- package/blockly-rc/demos/mobile/android/app/src/main/res/values/js_dialog_helper.xml +0 -7
- package/blockly-rc/demos/mobile/android/app/src/main/res/values/strings.xml +0 -3
- package/blockly-rc/demos/mobile/android/app/src/main/res/values/styles.xml +0 -11
- package/blockly-rc/demos/mobile/android/app/src/test/java/com/example/blocklywebview/ExampleUnitTest.java +0 -17
- package/blockly-rc/demos/mobile/android/build.gradle +0 -27
- package/blockly-rc/demos/mobile/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/blockly-rc/demos/mobile/android/gradle/wrapper/gradle-wrapper.properties +0 -6
- package/blockly-rc/demos/mobile/android/gradle.properties +0 -13
- package/blockly-rc/demos/mobile/android/gradlew +0 -172
- package/blockly-rc/demos/mobile/android/gradlew.bat +0 -84
- package/blockly-rc/demos/mobile/android/settings.gradle +0 -1
- package/blockly-rc/demos/mobile/html/index.html +0 -31
- package/blockly-rc/demos/mobile/html/ln_resources.sh +0 -22
- package/blockly-rc/demos/mobile/html/toolbox_standard.js +0 -333
- package/blockly-rc/demos/mobile/ios/Blockly WebView/AppDelegate.swift +0 -46
- package/blockly-rc/demos/mobile/ios/Blockly WebView/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
- package/blockly-rc/demos/mobile/ios/Blockly WebView/Assets.xcassets/Contents.json +0 -6
- package/blockly-rc/demos/mobile/ios/Blockly WebView/Base.lproj/LaunchScreen.storyboard +0 -25
- package/blockly-rc/demos/mobile/ios/Blockly WebView/Base.lproj/Main.storyboard +0 -44
- package/blockly-rc/demos/mobile/ios/Blockly WebView/Info.plist +0 -45
- package/blockly-rc/demos/mobile/ios/Blockly WebView/ViewController.swift +0 -110
- package/blockly-rc/demos/mobile/ios/Blockly WebView.xcodeproj/project.pbxproj +0 -390
- package/blockly-rc/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/blockly-rc/demos/mobile/ios/Blockly WebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/blockly-rc/demos/mobile/ios/cp_resources.sh +0 -21
- package/blockly-rc/demos/storage/icon.png +0 -0
- package/blockly-rc/demos/storage/index.html +0 -104
- package/blockly-rc/generators/dart/dart_generator.ts +0 -321
- package/blockly-rc/generators/dart/lists.ts +0 -525
- package/blockly-rc/generators/dart/logic.ts +0 -155
- package/blockly-rc/generators/dart/loops.ts +0 -217
- package/blockly-rc/generators/dart/math.ts +0 -559
- package/blockly-rc/generators/dart/procedures.ts +0 -138
- package/blockly-rc/generators/dart/text.ts +0 -405
- package/blockly-rc/generators/dart/variables.ts +0 -32
- package/blockly-rc/generators/dart/variables_dynamic.ts +0 -17
- package/blockly-rc/generators/dart.ts +0 -50
- package/blockly-rc/generators/javascript/javascript_generator.ts +0 -346
- package/blockly-rc/generators/javascript/lists.ts +0 -465
- package/blockly-rc/generators/javascript/logic.ts +0 -153
- package/blockly-rc/generators/javascript/loops.ts +0 -245
- package/blockly-rc/generators/javascript/math.ts +0 -450
- package/blockly-rc/generators/javascript/procedures.ts +0 -142
- package/blockly-rc/generators/javascript/text.ts +0 -418
- package/blockly-rc/generators/javascript/variables.ts +0 -32
- package/blockly-rc/generators/javascript/variables_dynamic.ts +0 -17
- package/blockly-rc/generators/javascript.ts +0 -46
- package/blockly-rc/generators/lua/lists.ts +0 -445
- package/blockly-rc/generators/lua/logic.ts +0 -142
- package/blockly-rc/generators/lua/loops.ts +0 -192
- package/blockly-rc/generators/lua/lua_generator.ts +0 -225
- package/blockly-rc/generators/lua/math.ts +0 -473
- package/blockly-rc/generators/lua/procedures.ts +0 -144
- package/blockly-rc/generators/lua/text.ts +0 -380
- package/blockly-rc/generators/lua/variables.ts +0 -31
- package/blockly-rc/generators/lua/variables_dynamic.ts +0 -17
- package/blockly-rc/generators/lua.ts +0 -44
- package/blockly-rc/generators/php/lists.ts +0 -585
- package/blockly-rc/generators/php/logic.ts +0 -155
- package/blockly-rc/generators/php/loops.ts +0 -218
- package/blockly-rc/generators/php/math.ts +0 -408
- package/blockly-rc/generators/php/php_generator.ts +0 -320
- package/blockly-rc/generators/php/procedures.ts +0 -159
- package/blockly-rc/generators/php/text.ts +0 -315
- package/blockly-rc/generators/php/variables.ts +0 -32
- package/blockly-rc/generators/php/variables_dynamic.ts +0 -17
- package/blockly-rc/generators/php.ts +0 -46
- package/blockly-rc/generators/python/lists.ts +0 -398
- package/blockly-rc/generators/python/logic.ts +0 -148
- package/blockly-rc/generators/python/loops.ts +0 -251
- package/blockly-rc/generators/python/math.ts +0 -434
- package/blockly-rc/generators/python/procedures.ts +0 -159
- package/blockly-rc/generators/python/python_generator.ts +0 -355
- package/blockly-rc/generators/python/text.ts +0 -338
- package/blockly-rc/generators/python/variables.ts +0 -31
- package/blockly-rc/generators/python/variables_dynamic.ts +0 -17
- package/blockly-rc/generators/python.ts +0 -51
- package/blockly-rc/gulpfile.js +0 -54
- package/blockly-rc/jsconfig.json +0 -7
- package/blockly-rc/media/1x1.gif +0 -0
- package/blockly-rc/media/click.mp3 +0 -0
- package/blockly-rc/media/click.ogg +0 -0
- package/blockly-rc/media/click.wav +0 -0
- package/blockly-rc/media/delete-icon.svg +0 -1
- package/blockly-rc/media/delete.mp3 +0 -0
- package/blockly-rc/media/delete.ogg +0 -0
- package/blockly-rc/media/delete.wav +0 -0
- package/blockly-rc/media/disconnect.mp3 +0 -0
- package/blockly-rc/media/disconnect.ogg +0 -0
- package/blockly-rc/media/disconnect.wav +0 -0
- package/blockly-rc/media/dropdown-arrow.svg +0 -1
- package/blockly-rc/media/foldout-icon.svg +0 -1
- package/blockly-rc/media/handclosed.cur +0 -0
- package/blockly-rc/media/handdelete.cur +0 -0
- package/blockly-rc/media/handopen.cur +0 -0
- package/blockly-rc/media/pilcrow.png +0 -0
- package/blockly-rc/media/quote0.png +0 -0
- package/blockly-rc/media/quote1.png +0 -0
- package/blockly-rc/media/resize-handle.svg +0 -3
- package/blockly-rc/media/sprites.png +0 -0
- package/blockly-rc/media/sprites.svg +0 -74
- package/blockly-rc/msg/json/README.md +0 -33
- package/blockly-rc/msg/json/ab.json +0 -222
- package/blockly-rc/msg/json/ace.json +0 -7
- package/blockly-rc/msg/json/af.json +0 -34
- package/blockly-rc/msg/json/am.json +0 -30
- package/blockly-rc/msg/json/ar.json +0 -355
- package/blockly-rc/msg/json/ast.json +0 -10
- package/blockly-rc/msg/json/az.json +0 -332
- package/blockly-rc/msg/json/ba.json +0 -211
- package/blockly-rc/msg/json/bcc.json +0 -290
- package/blockly-rc/msg/json/be-tarask.json +0 -334
- package/blockly-rc/msg/json/be.json +0 -324
- package/blockly-rc/msg/json/bg.json +0 -345
- package/blockly-rc/msg/json/bn.json +0 -189
- package/blockly-rc/msg/json/br.json +0 -334
- package/blockly-rc/msg/json/bs.json +0 -166
- package/blockly-rc/msg/json/ca.json +0 -341
- package/blockly-rc/msg/json/cdo.json +0 -6
- package/blockly-rc/msg/json/ce.json +0 -326
- package/blockly-rc/msg/json/constants.json +0 -12
- package/blockly-rc/msg/json/cs.json +0 -343
- package/blockly-rc/msg/json/da.json +0 -346
- package/blockly-rc/msg/json/de.json +0 -369
- package/blockly-rc/msg/json/diq.json +0 -258
- package/blockly-rc/msg/json/dtp.json +0 -198
- package/blockly-rc/msg/json/dty.json +0 -97
- package/blockly-rc/msg/json/ee.json +0 -160
- package/blockly-rc/msg/json/el.json +0 -356
- package/blockly-rc/msg/json/en-gb.json +0 -199
- package/blockly-rc/msg/json/en.json +0 -400
- package/blockly-rc/msg/json/eo.json +0 -337
- package/blockly-rc/msg/json/es.json +0 -358
- package/blockly-rc/msg/json/et.json +0 -326
- package/blockly-rc/msg/json/eu.json +0 -219
- package/blockly-rc/msg/json/fa.json +0 -341
- package/blockly-rc/msg/json/fi.json +0 -350
- package/blockly-rc/msg/json/fo.json +0 -46
- package/blockly-rc/msg/json/fr.json +0 -373
- package/blockly-rc/msg/json/frr.json +0 -6
- package/blockly-rc/msg/json/gl.json +0 -338
- package/blockly-rc/msg/json/gn.json +0 -54
- package/blockly-rc/msg/json/gor.json +0 -87
- package/blockly-rc/msg/json/ha.json +0 -313
- package/blockly-rc/msg/json/hak.json +0 -17
- package/blockly-rc/msg/json/he.json +0 -354
- package/blockly-rc/msg/json/hi.json +0 -318
- package/blockly-rc/msg/json/hr.json +0 -327
- package/blockly-rc/msg/json/hrx.json +0 -287
- package/blockly-rc/msg/json/hsb.json +0 -128
- package/blockly-rc/msg/json/hu.json +0 -349
- package/blockly-rc/msg/json/hy.json +0 -337
- package/blockly-rc/msg/json/ia.json +0 -337
- package/blockly-rc/msg/json/id.json +0 -335
- package/blockly-rc/msg/json/ig.json +0 -323
- package/blockly-rc/msg/json/inh.json +0 -80
- package/blockly-rc/msg/json/is.json +0 -331
- package/blockly-rc/msg/json/it.json +0 -346
- package/blockly-rc/msg/json/ja.json +0 -361
- package/blockly-rc/msg/json/ka.json +0 -14
- package/blockly-rc/msg/json/kab.json +0 -323
- package/blockly-rc/msg/json/kbd-cyrl.json +0 -84
- package/blockly-rc/msg/json/km.json +0 -29
- package/blockly-rc/msg/json/kn.json +0 -332
- package/blockly-rc/msg/json/ko.json +0 -372
- package/blockly-rc/msg/json/ksh.json +0 -43
- package/blockly-rc/msg/json/ku-latn.json +0 -41
- package/blockly-rc/msg/json/ky.json +0 -71
- package/blockly-rc/msg/json/la.json +0 -6
- package/blockly-rc/msg/json/lb.json +0 -156
- package/blockly-rc/msg/json/lki.json +0 -282
- package/blockly-rc/msg/json/lo.json +0 -92
- package/blockly-rc/msg/json/lrc.json +0 -123
- package/blockly-rc/msg/json/lt.json +0 -321
- package/blockly-rc/msg/json/lv.json +0 -324
- package/blockly-rc/msg/json/mg.json +0 -58
- package/blockly-rc/msg/json/mk.json +0 -178
- package/blockly-rc/msg/json/ml.json +0 -35
- package/blockly-rc/msg/json/mnw.json +0 -90
- package/blockly-rc/msg/json/ms.json +0 -300
- package/blockly-rc/msg/json/my.json +0 -57
- package/blockly-rc/msg/json/mzn.json +0 -6
- package/blockly-rc/msg/json/nb.json +0 -330
- package/blockly-rc/msg/json/ne.json +0 -247
- package/blockly-rc/msg/json/nl.json +0 -357
- package/blockly-rc/msg/json/oc.json +0 -194
- package/blockly-rc/msg/json/olo.json +0 -37
- package/blockly-rc/msg/json/pa.json +0 -69
- package/blockly-rc/msg/json/pl.json +0 -357
- package/blockly-rc/msg/json/pms.json +0 -324
- package/blockly-rc/msg/json/ps.json +0 -50
- package/blockly-rc/msg/json/pt-br.json +0 -369
- package/blockly-rc/msg/json/pt.json +0 -358
- package/blockly-rc/msg/json/qqq.json +0 -406
- package/blockly-rc/msg/json/ro.json +0 -333
- package/blockly-rc/msg/json/ru.json +0 -363
- package/blockly-rc/msg/json/sc.json +0 -283
- package/blockly-rc/msg/json/sco.json +0 -11
- package/blockly-rc/msg/json/sd.json +0 -158
- package/blockly-rc/msg/json/shn.json +0 -109
- package/blockly-rc/msg/json/si.json +0 -16
- package/blockly-rc/msg/json/sk.json +0 -332
- package/blockly-rc/msg/json/skr-arab.json +0 -117
- package/blockly-rc/msg/json/sl.json +0 -355
- package/blockly-rc/msg/json/smn.json +0 -133
- package/blockly-rc/msg/json/sq.json +0 -343
- package/blockly-rc/msg/json/sr-latn.json +0 -324
- package/blockly-rc/msg/json/sr.json +0 -348
- package/blockly-rc/msg/json/sv.json +0 -347
- package/blockly-rc/msg/json/sw.json +0 -12
- package/blockly-rc/msg/json/synonyms.json +0 -22
- package/blockly-rc/msg/json/ta.json +0 -306
- package/blockly-rc/msg/json/tcy.json +0 -316
- package/blockly-rc/msg/json/tdd.json +0 -109
- package/blockly-rc/msg/json/te.json +0 -101
- package/blockly-rc/msg/json/th.json +0 -333
- package/blockly-rc/msg/json/ti.json +0 -50
- package/blockly-rc/msg/json/tl.json +0 -129
- package/blockly-rc/msg/json/tlh.json +0 -179
- package/blockly-rc/msg/json/tr.json +0 -369
- package/blockly-rc/msg/json/ug-arab.json +0 -132
- package/blockly-rc/msg/json/uk.json +0 -345
- package/blockly-rc/msg/json/ur.json +0 -117
- package/blockly-rc/msg/json/uz.json +0 -36
- package/blockly-rc/msg/json/vi.json +0 -345
- package/blockly-rc/msg/json/xmf.json +0 -96
- package/blockly-rc/msg/json/yo.json +0 -316
- package/blockly-rc/msg/json/zgh.json +0 -83
- package/blockly-rc/msg/json/zh-hans.json +0 -372
- package/blockly-rc/msg/json/zh-hant.json +0 -362
- package/blockly-rc/msg/messages.js +0 -1616
- package/blockly-rc/package-lock.json +0 -12324
- package/blockly-rc/package.json +0 -149
- package/blockly-rc/patches/@microsoft+api-documenter+7.22.4.patch +0 -81
- package/blockly-rc/scripts/goog_module/convert-file.sh +0 -406
- package/blockly-rc/scripts/gulpfiles/appengine_tasks.js +0 -195
- package/blockly-rc/scripts/gulpfiles/build_tasks.js +0 -752
- package/blockly-rc/scripts/gulpfiles/config.js +0 -41
- package/blockly-rc/scripts/gulpfiles/docs_tasks.js +0 -147
- package/blockly-rc/scripts/gulpfiles/git_tasks.js +0 -181
- package/blockly-rc/scripts/gulpfiles/helper_tasks.js +0 -19
- package/blockly-rc/scripts/gulpfiles/package_tasks.js +0 -262
- package/blockly-rc/scripts/gulpfiles/release_tasks.js +0 -183
- package/blockly-rc/scripts/gulpfiles/test_tasks.js +0 -405
- package/blockly-rc/scripts/helpers.js +0 -74
- package/blockly-rc/scripts/i18n/common.py +0 -233
- package/blockly-rc/scripts/i18n/create_messages.py +0 -167
- package/blockly-rc/scripts/i18n/dedup_json.py +0 -72
- package/blockly-rc/scripts/i18n/js_to_json.py +0 -135
- package/blockly-rc/scripts/i18n/tests.py +0 -46
- package/blockly-rc/scripts/migration/cjs2esm +0 -162
- package/blockly-rc/scripts/migration/js2ts +0 -168
- package/blockly-rc/scripts/migration/renamings.json5 +0 -1599
- package/blockly-rc/scripts/package/README.md +0 -93
- package/blockly-rc/scripts/package/core-node.js +0 -31
- package/blockly-rc/scripts/package/index.js +0 -23
- package/blockly-rc/scripts/package/templates/umd-msg.template +0 -16
- package/blockly-rc/scripts/package/templates/umd.template +0 -13
- package/blockly-rc/scripts/themes/blockStyles_example.json +0 -11
- package/blockly-rc/scripts/themes/create_blockStyles.py +0 -181
- package/blockly-rc/scripts/tsick.js +0 -86
- package/blockly-rc/tests/.eslintrc.json +0 -10
- package/blockly-rc/tests/browser/.eslintrc.json +0 -29
- package/blockly-rc/tests/browser/.mocharc.js +0 -6
- package/blockly-rc/tests/browser/test/basic_block_factory_test.mjs +0 -44
- package/blockly-rc/tests/browser/test/basic_block_test.mjs +0 -39
- package/blockly-rc/tests/browser/test/basic_playground_test.mjs +0 -198
- package/blockly-rc/tests/browser/test/block_undo_test.mjs +0 -50
- package/blockly-rc/tests/browser/test/delete_blocks_test.mjs +0 -211
- package/blockly-rc/tests/browser/test/extensive_test.mjs +0 -195
- package/blockly-rc/tests/browser/test/field_edits_test.mjs +0 -61
- package/blockly-rc/tests/browser/test/hooks.mjs +0 -23
- package/blockly-rc/tests/browser/test/mutator_test.mjs +0 -88
- package/blockly-rc/tests/browser/test/procedure_test.mjs +0 -109
- package/blockly-rc/tests/browser/test/test_setup.mjs +0 -589
- package/blockly-rc/tests/browser/test/toolbox_drag_test.mjs +0 -207
- package/blockly-rc/tests/browser/test/workspace_comment_test.mjs +0 -224
- package/blockly-rc/tests/compile/index.html +0 -43
- package/blockly-rc/tests/compile/main.js +0 -53
- package/blockly-rc/tests/compile/test_blocks.js +0 -47
- package/blockly-rc/tests/compile/webdriver.js +0 -81
- package/blockly-rc/tests/generators/functions.xml +0 -561
- package/blockly-rc/tests/generators/golden/generated.dart +0 -1604
- package/blockly-rc/tests/generators/golden/generated.js +0 -1552
- package/blockly-rc/tests/generators/golden/generated.lua +0 -1828
- package/blockly-rc/tests/generators/golden/generated.php +0 -1611
- package/blockly-rc/tests/generators/golden/generated.py +0 -1407
- package/blockly-rc/tests/generators/index.html +0 -405
- package/blockly-rc/tests/generators/lists.xml +0 -8675
- package/blockly-rc/tests/generators/logic.xml +0 -1019
- package/blockly-rc/tests/generators/loops1.xml +0 -345
- package/blockly-rc/tests/generators/loops2.xml +0 -891
- package/blockly-rc/tests/generators/loops3.xml +0 -735
- package/blockly-rc/tests/generators/math.xml +0 -2077
- package/blockly-rc/tests/generators/text.xml +0 -4651
- package/blockly-rc/tests/generators/unittest.js +0 -103
- package/blockly-rc/tests/generators/unittest_dart.js +0 -163
- package/blockly-rc/tests/generators/unittest_javascript.js +0 -167
- package/blockly-rc/tests/generators/unittest_lua.js +0 -165
- package/blockly-rc/tests/generators/unittest_php.js +0 -154
- package/blockly-rc/tests/generators/unittest_python.js +0 -138
- package/blockly-rc/tests/generators/variables.xml +0 -68
- package/blockly-rc/tests/generators/webdriver.js +0 -123
- package/blockly-rc/tests/media/200px.png +0 -0
- package/blockly-rc/tests/media/30px.png +0 -0
- package/blockly-rc/tests/media/50px.png +0 -0
- package/blockly-rc/tests/media/a.png +0 -0
- package/blockly-rc/tests/media/arrow.png +0 -0
- package/blockly-rc/tests/media/b.png +0 -0
- package/blockly-rc/tests/media/c.png +0 -0
- package/blockly-rc/tests/media/d.png +0 -0
- package/blockly-rc/tests/media/e.png +0 -0
- package/blockly-rc/tests/media/f.png +0 -0
- package/blockly-rc/tests/media/g.png +0 -0
- package/blockly-rc/tests/media/h.png +0 -0
- package/blockly-rc/tests/media/i.png +0 -0
- package/blockly-rc/tests/media/j.png +0 -0
- package/blockly-rc/tests/media/k.png +0 -0
- package/blockly-rc/tests/media/l.png +0 -0
- package/blockly-rc/tests/media/m.png +0 -0
- package/blockly-rc/tests/migration/renamings.schema.json +0 -59
- package/blockly-rc/tests/migration/validate-renamings.mjs +0 -60
- package/blockly-rc/tests/mocha/.eslintrc.json +0 -21
- package/blockly-rc/tests/mocha/.mocharc.js +0 -6
- package/blockly-rc/tests/mocha/astnode_test.js +0 -850
- package/blockly-rc/tests/mocha/block_json_test.js +0 -777
- package/blockly-rc/tests/mocha/block_test.js +0 -2743
- package/blockly-rc/tests/mocha/blocks/lists_test.js +0 -196
- package/blockly-rc/tests/mocha/blocks/logic_ternary_test.js +0 -320
- package/blockly-rc/tests/mocha/blocks/loops_test.js +0 -56
- package/blockly-rc/tests/mocha/blocks/procedures_test.js +0 -2495
- package/blockly-rc/tests/mocha/blocks/variables_test.js +0 -311
- package/blockly-rc/tests/mocha/clipboard_test.js +0 -136
- package/blockly-rc/tests/mocha/comment_deserialization_test.js +0 -122
- package/blockly-rc/tests/mocha/comment_test.js +0 -170
- package/blockly-rc/tests/mocha/comment_view_test.js +0 -188
- package/blockly-rc/tests/mocha/connection_checker_test.js +0 -666
- package/blockly-rc/tests/mocha/connection_db_test.js +0 -362
- package/blockly-rc/tests/mocha/connection_test.js +0 -3738
- package/blockly-rc/tests/mocha/contextmenu_items_test.js +0 -488
- package/blockly-rc/tests/mocha/contextmenu_test.js +0 -71
- package/blockly-rc/tests/mocha/cursor_test.js +0 -134
- package/blockly-rc/tests/mocha/dropdowndiv_test.js +0 -116
- package/blockly-rc/tests/mocha/event_block_change_test.js +0 -126
- package/blockly-rc/tests/mocha/event_block_create_test.js +0 -109
- package/blockly-rc/tests/mocha/event_block_delete_test.js +0 -55
- package/blockly-rc/tests/mocha/event_block_drag_test.js +0 -36
- package/blockly-rc/tests/mocha/event_block_field_intermediate_change_test.js +0 -67
- package/blockly-rc/tests/mocha/event_block_move_test.js +0 -39
- package/blockly-rc/tests/mocha/event_bubble_open_test.js +0 -42
- package/blockly-rc/tests/mocha/event_click_test.js +0 -40
- package/blockly-rc/tests/mocha/event_comment_change_test.js +0 -39
- package/blockly-rc/tests/mocha/event_comment_collapse_test.js +0 -34
- package/blockly-rc/tests/mocha/event_comment_create_test.js +0 -38
- package/blockly-rc/tests/mocha/event_comment_delete_test.js +0 -38
- package/blockly-rc/tests/mocha/event_comment_drag_test.js +0 -35
- package/blockly-rc/tests/mocha/event_comment_move_test.js +0 -40
- package/blockly-rc/tests/mocha/event_comment_resize_test.js +0 -38
- package/blockly-rc/tests/mocha/event_marker_move_test.js +0 -44
- package/blockly-rc/tests/mocha/event_selected_test.js +0 -41
- package/blockly-rc/tests/mocha/event_test.js +0 -1578
- package/blockly-rc/tests/mocha/event_theme_change_test.js +0 -36
- package/blockly-rc/tests/mocha/event_toolbox_item_select_test.js +0 -64
- package/blockly-rc/tests/mocha/event_trashcan_open_test.js +0 -36
- package/blockly-rc/tests/mocha/event_var_create_test.js +0 -54
- package/blockly-rc/tests/mocha/event_var_delete_test.js +0 -54
- package/blockly-rc/tests/mocha/event_var_rename_test.js +0 -39
- package/blockly-rc/tests/mocha/event_var_type_change_test.js +0 -43
- package/blockly-rc/tests/mocha/event_viewport_test.js +0 -39
- package/blockly-rc/tests/mocha/extensions_test.js +0 -613
- package/blockly-rc/tests/mocha/field_checkbox_test.js +0 -299
- package/blockly-rc/tests/mocha/field_colour_test.js +0 -395
- package/blockly-rc/tests/mocha/field_dropdown_test.js +0 -282
- package/blockly-rc/tests/mocha/field_image_test.js +0 -241
- package/blockly-rc/tests/mocha/field_label_serializable_test.js +0 -252
- package/blockly-rc/tests/mocha/field_label_test.js +0 -226
- package/blockly-rc/tests/mocha/field_number_test.js +0 -505
- package/blockly-rc/tests/mocha/field_registry_test.js +0 -116
- package/blockly-rc/tests/mocha/field_test.js +0 -822
- package/blockly-rc/tests/mocha/field_textinput_test.js +0 -297
- package/blockly-rc/tests/mocha/field_variable_test.js +0 -611
- package/blockly-rc/tests/mocha/flyout_test.js +0 -638
- package/blockly-rc/tests/mocha/generator_test.js +0 -233
- package/blockly-rc/tests/mocha/gesture_test.js +0 -97
- package/blockly-rc/tests/mocha/icon_test.js +0 -369
- package/blockly-rc/tests/mocha/index.html +0 -229
- package/blockly-rc/tests/mocha/input_test.js +0 -296
- package/blockly-rc/tests/mocha/insertion_marker_manager_test.js +0 -443
- package/blockly-rc/tests/mocha/insertion_marker_test.js +0 -432
- package/blockly-rc/tests/mocha/jso_deserialization_test.js +0 -849
- package/blockly-rc/tests/mocha/jso_serialization_test.js +0 -1067
- package/blockly-rc/tests/mocha/json_test.js +0 -315
- package/blockly-rc/tests/mocha/keydown_test.js +0 -364
- package/blockly-rc/tests/mocha/layering_test.js +0 -95
- package/blockly-rc/tests/mocha/metrics_test.js +0 -671
- package/blockly-rc/tests/mocha/mutator_test.js +0 -87
- package/blockly-rc/tests/mocha/names_test.js +0 -97
- package/blockly-rc/tests/mocha/old_workspace_comment_test.js +0 -256
- package/blockly-rc/tests/mocha/procedure_map_test.js +0 -57
- package/blockly-rc/tests/mocha/registry_test.js +0 -281
- package/blockly-rc/tests/mocha/render_management_test.js +0 -127
- package/blockly-rc/tests/mocha/serializer_test.js +0 -2104
- package/blockly-rc/tests/mocha/shortcut_registry_test.js +0 -450
- package/blockly-rc/tests/mocha/test_helpers/block_definitions.js +0 -204
- package/blockly-rc/tests/mocha/test_helpers/code_generation.js +0 -115
- package/blockly-rc/tests/mocha/test_helpers/common.js +0 -106
- package/blockly-rc/tests/mocha/test_helpers/events.js +0 -290
- package/blockly-rc/tests/mocha/test_helpers/fields.js +0 -310
- package/blockly-rc/tests/mocha/test_helpers/icon_mocks.js +0 -81
- package/blockly-rc/tests/mocha/test_helpers/procedures.js +0 -302
- package/blockly-rc/tests/mocha/test_helpers/serialization.js +0 -124
- package/blockly-rc/tests/mocha/test_helpers/setup_teardown.js +0 -209
- package/blockly-rc/tests/mocha/test_helpers/toolbox_definitions.js +0 -271
- package/blockly-rc/tests/mocha/test_helpers/user_input.js +0 -62
- package/blockly-rc/tests/mocha/test_helpers/variables.js +0 -23
- package/blockly-rc/tests/mocha/test_helpers/warnings.js +0 -83
- package/blockly-rc/tests/mocha/test_helpers/workspace.js +0 -1691
- package/blockly-rc/tests/mocha/theme_test.js +0 -307
- package/blockly-rc/tests/mocha/toolbox_test.js +0 -761
- package/blockly-rc/tests/mocha/tooltip_test.js +0 -276
- package/blockly-rc/tests/mocha/touch_test.js +0 -109
- package/blockly-rc/tests/mocha/trashcan_test.js +0 -375
- package/blockly-rc/tests/mocha/utils_test.js +0 -536
- package/blockly-rc/tests/mocha/variable_map_test.js +0 -509
- package/blockly-rc/tests/mocha/variable_model_test.js +0 -85
- package/blockly-rc/tests/mocha/webdriver.js +0 -96
- package/blockly-rc/tests/mocha/widget_div_test.js +0 -272
- package/blockly-rc/tests/mocha/workspace_comment_test.js +0 -171
- package/blockly-rc/tests/mocha/workspace_svg_test.js +0 -414
- package/blockly-rc/tests/mocha/workspace_test.js +0 -27
- package/blockly-rc/tests/mocha/xml_test.js +0 -951
- package/blockly-rc/tests/mocha/zoom_controls_test.js +0 -81
- package/blockly-rc/tests/multi_playground.html +0 -482
- package/blockly-rc/tests/node/.eslintrc.json +0 -12
- package/blockly-rc/tests/node/.mocharc.js +0 -6
- package/blockly-rc/tests/node/run_node_test.mjs +0 -72
- package/blockly-rc/tests/playground.html +0 -1280
- package/blockly-rc/tests/playgrounds/advanced_playground.html +0 -158
- package/blockly-rc/tests/playgrounds/iframe.html +0 -40
- package/blockly-rc/tests/playgrounds/screenshot.js +0 -123
- package/blockly-rc/tests/scripts/check_metadata.sh +0 -166
- package/blockly-rc/tests/scripts/compile_typings.sh +0 -32
- package/blockly-rc/tests/scripts/load.mjs +0 -140
- package/blockly-rc/tests/scripts/setup_linux_env.sh +0 -7
- package/blockly-rc/tests/scripts/update_metadata.sh +0 -46
- package/blockly-rc/tests/themes/test_themes.js +0 -62
- package/blockly-rc/tests/typescript/README.md +0 -4
- package/blockly-rc/tests/typescript/src/field/different_user_input.ts +0 -81
- package/blockly-rc/tests/typescript/src/generators/dart.ts +0 -24
- package/blockly-rc/tests/typescript/src/generators/javascript.ts +0 -28
- package/blockly-rc/tests/typescript/src/generators/lua.ts +0 -24
- package/blockly-rc/tests/typescript/src/generators/php.ts +0 -24
- package/blockly-rc/tests/typescript/src/generators/python.ts +0 -24
- package/blockly-rc/tests/typescript/src/generators.ts +0 -31
- package/blockly-rc/tests/typescript/src/msg.ts +0 -20
- package/blockly-rc/tests/typescript/tsconfig.json +0 -20
- package/blockly-rc/tests/xml/README.txt +0 -11
- package/blockly-rc/tests/xml/blockly.xsd +0 -178
- package/blockly-rc/tests/xml/invalid.xml +0 -6
- package/blockly-rc/tests/xml/toolbox.xml +0 -311
- package/blockly-rc/tests/xml/workspace.xml +0 -114
- package/blockly-rc/tsconfig.json +0 -37
- package/blockly-rc/tsdoc.json +0 -35
- package/blockly-rc/typings/README.md +0 -5
- package/blockly-rc/typings/blocks.d.ts +0 -17
- package/blockly-rc/typings/core.d.ts +0 -7
- package/blockly-rc/typings/dart.d.ts +0 -7
- package/blockly-rc/typings/index.d.ts +0 -10
- package/blockly-rc/typings/javascript.d.ts +0 -7
- package/blockly-rc/typings/lua.d.ts +0 -7
- package/blockly-rc/typings/msg/ab.d.ts +0 -8
- package/blockly-rc/typings/msg/ace.d.ts +0 -8
- package/blockly-rc/typings/msg/af.d.ts +0 -8
- package/blockly-rc/typings/msg/am.d.ts +0 -8
- package/blockly-rc/typings/msg/ar.d.ts +0 -8
- package/blockly-rc/typings/msg/ast.d.ts +0 -8
- package/blockly-rc/typings/msg/az.d.ts +0 -8
- package/blockly-rc/typings/msg/ba.d.ts +0 -8
- package/blockly-rc/typings/msg/bcc.d.ts +0 -8
- package/blockly-rc/typings/msg/be-tarask.d.ts +0 -8
- package/blockly-rc/typings/msg/be.d.ts +0 -8
- package/blockly-rc/typings/msg/bg.d.ts +0 -8
- package/blockly-rc/typings/msg/bn.d.ts +0 -8
- package/blockly-rc/typings/msg/br.d.ts +0 -8
- package/blockly-rc/typings/msg/bs.d.ts +0 -8
- package/blockly-rc/typings/msg/ca.d.ts +0 -8
- package/blockly-rc/typings/msg/cdo.d.ts +0 -8
- package/blockly-rc/typings/msg/ce.d.ts +0 -8
- package/blockly-rc/typings/msg/cs.d.ts +0 -8
- package/blockly-rc/typings/msg/da.d.ts +0 -8
- package/blockly-rc/typings/msg/de.d.ts +0 -8
- package/blockly-rc/typings/msg/diq.d.ts +0 -8
- package/blockly-rc/typings/msg/dtp.d.ts +0 -8
- package/blockly-rc/typings/msg/dty.d.ts +0 -8
- package/blockly-rc/typings/msg/ee.d.ts +0 -8
- package/blockly-rc/typings/msg/el.d.ts +0 -8
- package/blockly-rc/typings/msg/en-gb.d.ts +0 -8
- package/blockly-rc/typings/msg/en.d.ts +0 -8
- package/blockly-rc/typings/msg/eo.d.ts +0 -8
- package/blockly-rc/typings/msg/es.d.ts +0 -8
- package/blockly-rc/typings/msg/et.d.ts +0 -8
- package/blockly-rc/typings/msg/eu.d.ts +0 -8
- package/blockly-rc/typings/msg/fa.d.ts +0 -8
- package/blockly-rc/typings/msg/fi.d.ts +0 -8
- package/blockly-rc/typings/msg/fo.d.ts +0 -8
- package/blockly-rc/typings/msg/fr.d.ts +0 -8
- package/blockly-rc/typings/msg/frr.d.ts +0 -8
- package/blockly-rc/typings/msg/gl.d.ts +0 -8
- package/blockly-rc/typings/msg/gn.d.ts +0 -8
- package/blockly-rc/typings/msg/gor.d.ts +0 -8
- package/blockly-rc/typings/msg/ha.d.ts +0 -8
- package/blockly-rc/typings/msg/hak.d.ts +0 -8
- package/blockly-rc/typings/msg/he.d.ts +0 -8
- package/blockly-rc/typings/msg/hi.d.ts +0 -8
- package/blockly-rc/typings/msg/hr.d.ts +0 -8
- package/blockly-rc/typings/msg/hrx.d.ts +0 -8
- package/blockly-rc/typings/msg/hsb.d.ts +0 -8
- package/blockly-rc/typings/msg/hu.d.ts +0 -8
- package/blockly-rc/typings/msg/hy.d.ts +0 -8
- package/blockly-rc/typings/msg/ia.d.ts +0 -8
- package/blockly-rc/typings/msg/id.d.ts +0 -8
- package/blockly-rc/typings/msg/ig.d.ts +0 -8
- package/blockly-rc/typings/msg/inh.d.ts +0 -8
- package/blockly-rc/typings/msg/is.d.ts +0 -8
- package/blockly-rc/typings/msg/it.d.ts +0 -8
- package/blockly-rc/typings/msg/ja.d.ts +0 -8
- package/blockly-rc/typings/msg/ka.d.ts +0 -8
- package/blockly-rc/typings/msg/kab.d.ts +0 -8
- package/blockly-rc/typings/msg/kbd-cyrl.d.ts +0 -8
- package/blockly-rc/typings/msg/km.d.ts +0 -8
- package/blockly-rc/typings/msg/kn.d.ts +0 -8
- package/blockly-rc/typings/msg/ko.d.ts +0 -8
- package/blockly-rc/typings/msg/ksh.d.ts +0 -8
- package/blockly-rc/typings/msg/ku-latn.d.ts +0 -8
- package/blockly-rc/typings/msg/ky.d.ts +0 -8
- package/blockly-rc/typings/msg/la.d.ts +0 -8
- package/blockly-rc/typings/msg/lb.d.ts +0 -8
- package/blockly-rc/typings/msg/lki.d.ts +0 -8
- package/blockly-rc/typings/msg/lo.d.ts +0 -8
- package/blockly-rc/typings/msg/lrc.d.ts +0 -8
- package/blockly-rc/typings/msg/lt.d.ts +0 -8
- package/blockly-rc/typings/msg/lv.d.ts +0 -8
- package/blockly-rc/typings/msg/mg.d.ts +0 -8
- package/blockly-rc/typings/msg/mk.d.ts +0 -8
- package/blockly-rc/typings/msg/ml.d.ts +0 -8
- package/blockly-rc/typings/msg/mnw.d.ts +0 -8
- package/blockly-rc/typings/msg/ms.d.ts +0 -8
- package/blockly-rc/typings/msg/msg.d.ts +0 -440
- package/blockly-rc/typings/msg/my.d.ts +0 -8
- package/blockly-rc/typings/msg/mzn.d.ts +0 -8
- package/blockly-rc/typings/msg/nb.d.ts +0 -8
- package/blockly-rc/typings/msg/ne.d.ts +0 -8
- package/blockly-rc/typings/msg/nl.d.ts +0 -8
- package/blockly-rc/typings/msg/oc.d.ts +0 -8
- package/blockly-rc/typings/msg/olo.d.ts +0 -8
- package/blockly-rc/typings/msg/pa.d.ts +0 -8
- package/blockly-rc/typings/msg/pl.d.ts +0 -8
- package/blockly-rc/typings/msg/pms.d.ts +0 -8
- package/blockly-rc/typings/msg/ps.d.ts +0 -8
- package/blockly-rc/typings/msg/pt-br.d.ts +0 -8
- package/blockly-rc/typings/msg/pt.d.ts +0 -8
- package/blockly-rc/typings/msg/ro.d.ts +0 -8
- package/blockly-rc/typings/msg/ru.d.ts +0 -8
- package/blockly-rc/typings/msg/sc.d.ts +0 -8
- package/blockly-rc/typings/msg/sco.d.ts +0 -8
- package/blockly-rc/typings/msg/sd.d.ts +0 -8
- package/blockly-rc/typings/msg/shn.d.ts +0 -8
- package/blockly-rc/typings/msg/si.d.ts +0 -8
- package/blockly-rc/typings/msg/sk.d.ts +0 -8
- package/blockly-rc/typings/msg/skr-arab.d.ts +0 -8
- package/blockly-rc/typings/msg/sl.d.ts +0 -8
- package/blockly-rc/typings/msg/smn.d.ts +0 -8
- package/blockly-rc/typings/msg/sq.d.ts +0 -8
- package/blockly-rc/typings/msg/sr-latn.d.ts +0 -8
- package/blockly-rc/typings/msg/sr.d.ts +0 -8
- package/blockly-rc/typings/msg/sv.d.ts +0 -8
- package/blockly-rc/typings/msg/sw.d.ts +0 -8
- package/blockly-rc/typings/msg/ta.d.ts +0 -8
- package/blockly-rc/typings/msg/tcy.d.ts +0 -8
- package/blockly-rc/typings/msg/tdd.d.ts +0 -8
- package/blockly-rc/typings/msg/te.d.ts +0 -8
- package/blockly-rc/typings/msg/th.d.ts +0 -8
- package/blockly-rc/typings/msg/ti.d.ts +0 -8
- package/blockly-rc/typings/msg/tl.d.ts +0 -8
- package/blockly-rc/typings/msg/tlh.d.ts +0 -8
- package/blockly-rc/typings/msg/tr.d.ts +0 -8
- package/blockly-rc/typings/msg/ug-arab.d.ts +0 -8
- package/blockly-rc/typings/msg/uk.d.ts +0 -8
- package/blockly-rc/typings/msg/ur.d.ts +0 -8
- package/blockly-rc/typings/msg/uz.d.ts +0 -8
- package/blockly-rc/typings/msg/vi.d.ts +0 -8
- package/blockly-rc/typings/msg/xmf.d.ts +0 -8
- package/blockly-rc/typings/msg/yo.d.ts +0 -8
- package/blockly-rc/typings/msg/zgh.d.ts +0 -8
- package/blockly-rc/typings/msg/zh-hans.d.ts +0 -8
- package/blockly-rc/typings/msg/zh-hant.d.ts +0 -8
- package/blockly-rc/typings/php.d.ts +0 -7
- package/blockly-rc/typings/python.d.ts +0 -7
- package/blockly-rc/typings/templates/blockly-header.template +0 -11
- package/blockly-rc/typings/templates/blockly-interfaces.template +0 -83
- package/blockly-rc/typings/templates/msg.template +0 -15
- package/blockly-rc/typings/tsconfig.json +0 -23
- package/continuous-toolbox.d.ts +0 -1
- package/dist/main.js +0 -2
- package/dist/main.js.LICENSE.txt +0 -163
- package/media/delete-icon.svg +0 -10
- package/media/resize-handle.svg +0 -3
- package/src/block_reporting.js +0 -31
- package/src/blocks/colour.js +0 -56
- package/src/blocks/control.js +0 -492
- package/src/blocks/data.js +0 -690
- package/src/blocks/event.js +0 -305
- package/src/blocks/looks.js +0 -537
- package/src/blocks/math.js +0 -137
- package/src/blocks/matrix.js +0 -47
- package/src/blocks/motion.js +0 -513
- package/src/blocks/note.js +0 -48
- package/src/blocks/operators.js +0 -463
- package/src/blocks/procedures.js +0 -1009
- package/src/blocks/sensing.js +0 -441
- package/src/blocks/sound.js +0 -205
- package/src/blocks/text.js +0 -45
- package/src/blocks/vertical_extensions.js +0 -309
- package/src/categories.js +0 -15
- package/src/checkable_continuous_flyout.js +0 -138
- package/src/checkbox_bubble.js +0 -282
- package/src/colours.js +0 -77
- package/src/constants.js +0 -63
- package/src/context_menu_items.js +0 -150
- package/src/css.js +0 -1197
- package/src/data_category.js +0 -556
- package/src/events/events_block_comment_base.js +0 -35
- package/src/events/events_block_comment_change.js +0 -43
- package/src/events/events_block_comment_collapse.js +0 -43
- package/src/events/events_block_comment_create.js +0 -52
- package/src/events/events_block_comment_delete.js +0 -27
- package/src/events/events_block_comment_move.js +0 -54
- package/src/events/events_block_comment_resize.js +0 -52
- package/src/events/events_block_drag_end.js +0 -33
- package/src/events/events_block_drag_outside.js +0 -30
- package/src/events/events_scratch_variable_create.js +0 -67
- package/src/fields/field_angle.js +0 -433
- package/src/fields/field_colour_slider.js +0 -388
- package/src/fields/field_dropdown.js +0 -42
- package/src/fields/field_matrix.js +0 -634
- package/src/fields/field_note.js +0 -937
- package/src/fields/field_number.js +0 -380
- package/src/fields/field_textinput_removable.js +0 -107
- package/src/fields/field_variable.js +0 -171
- package/src/fields/field_variable_getter.js +0 -109
- package/src/fields/field_vertical_separator.js +0 -139
- package/src/flyout_checkbox_icon.js +0 -88
- package/src/glows.js +0 -98
- package/src/index.ts +0 -137
- package/src/procedures.js +0 -425
- package/src/recyclable_block_flyout_inflater.js +0 -194
- package/src/renderer/bowler_hat.js +0 -17
- package/src/renderer/constants.js +0 -45
- package/src/renderer/drawer.js +0 -51
- package/src/renderer/path_object.js +0 -35
- package/src/renderer/render_info.js +0 -98
- package/src/renderer/renderer.js +0 -74
- package/src/scratch_block_paster.js +0 -46
- package/src/scratch_blocks_utils.js +0 -148
- package/src/scratch_comment_bubble.js +0 -169
- package/src/scratch_comment_icon.js +0 -195
- package/src/scratch_connection_checker.js +0 -29
- package/src/scratch_continuous_category.js +0 -80
- package/src/scratch_continuous_toolbox.js +0 -78
- package/src/scratch_dragger.js +0 -142
- package/src/scratch_variable_map.js +0 -25
- package/src/scratch_variable_model.js +0 -24
- package/src/shadows.js +0 -61
- package/src/status_indicator_label.js +0 -186
- package/src/status_indicator_label_flyout_inflater.js +0 -42
- package/src/variables.js +0 -355
- package/temp-use-blockly-v12-rc.sh +0 -26
- package/tsconfig.json +0 -13
- /package/media/{foldout-icon.svg → comment-arrow-down.svg} +0 -0
|
@@ -1,2495 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import {assert} from '../../../node_modules/chai/chai.js';
|
|
8
|
-
import * as Blockly from '../../../build/src/core/blockly.js';
|
|
9
|
-
import {
|
|
10
|
-
assertCallBlockStructure,
|
|
11
|
-
assertDefBlockStructure,
|
|
12
|
-
createProcDefBlock,
|
|
13
|
-
createProcCallBlock,
|
|
14
|
-
MockProcedureModel,
|
|
15
|
-
} from '../test_helpers/procedures.js';
|
|
16
|
-
import {runSerializationTestSuite} from '../test_helpers/serialization.js';
|
|
17
|
-
import {
|
|
18
|
-
createGenUidStubWithReturns,
|
|
19
|
-
sharedTestSetup,
|
|
20
|
-
sharedTestTeardown,
|
|
21
|
-
workspaceTeardown,
|
|
22
|
-
} from '../test_helpers/setup_teardown.js';
|
|
23
|
-
import {defineRowBlock} from '../test_helpers/block_definitions.js';
|
|
24
|
-
|
|
25
|
-
suite('Procedures', function () {
|
|
26
|
-
setup(function () {
|
|
27
|
-
sharedTestSetup.call(this, {fireEventsNow: false});
|
|
28
|
-
this.workspace = Blockly.inject('blocklyDiv', {});
|
|
29
|
-
this.workspace.createVariable('preCreatedVar', '', 'preCreatedVarId');
|
|
30
|
-
this.workspace.createVariable(
|
|
31
|
-
'preCreatedTypedVar',
|
|
32
|
-
'type',
|
|
33
|
-
'preCreatedTypedVarId',
|
|
34
|
-
);
|
|
35
|
-
defineRowBlock();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
teardown(function () {
|
|
39
|
-
sharedTestTeardown.call(this);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
suite('renaming procedures', function () {
|
|
43
|
-
test('callers are updated to have the new name', function () {
|
|
44
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
45
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
46
|
-
|
|
47
|
-
defBlock.setFieldValue('new name', 'NAME');
|
|
48
|
-
|
|
49
|
-
assert.equal(
|
|
50
|
-
callBlock.getFieldValue('NAME'),
|
|
51
|
-
'new name',
|
|
52
|
-
'Expected the procedure block to be renamed',
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
test(
|
|
57
|
-
'setting an illegal name results in both the ' +
|
|
58
|
-
'procedure and the caller getting the legal name',
|
|
59
|
-
function () {
|
|
60
|
-
createProcDefBlock(this.workspace, undefined, undefined, 'procA');
|
|
61
|
-
const defBlockB = createProcDefBlock(
|
|
62
|
-
this.workspace,
|
|
63
|
-
undefined,
|
|
64
|
-
undefined,
|
|
65
|
-
'procB',
|
|
66
|
-
);
|
|
67
|
-
const callBlockB = createProcCallBlock(
|
|
68
|
-
this.workspace,
|
|
69
|
-
undefined,
|
|
70
|
-
'procB',
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
defBlockB.setFieldValue('procA', 'NAME');
|
|
74
|
-
|
|
75
|
-
assert.notEqual(
|
|
76
|
-
defBlockB.getFieldValue('NAME'),
|
|
77
|
-
'procA',
|
|
78
|
-
'Expected the procedure def block to have a legal name',
|
|
79
|
-
);
|
|
80
|
-
assert.notEqual(
|
|
81
|
-
callBlockB.getFieldValue('NAME'),
|
|
82
|
-
'procA',
|
|
83
|
-
'Expected the procedure call block to have a legal name',
|
|
84
|
-
);
|
|
85
|
-
},
|
|
86
|
-
);
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
suite('adding procedure parameters', function () {
|
|
90
|
-
test('the mutator flyout updates to avoid parameter name conflicts', async function () {
|
|
91
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
92
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
93
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
94
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
95
|
-
const origFlyoutParamName = mutatorWorkspace
|
|
96
|
-
.getFlyout()
|
|
97
|
-
.getWorkspace()
|
|
98
|
-
.getTopBlocks(true)[0]
|
|
99
|
-
.getFieldValue('NAME');
|
|
100
|
-
Blockly.serialization.blocks.append(
|
|
101
|
-
{
|
|
102
|
-
'type': 'procedures_mutatorarg',
|
|
103
|
-
'fields': {
|
|
104
|
-
'NAME': origFlyoutParamName,
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
mutatorWorkspace,
|
|
108
|
-
);
|
|
109
|
-
this.clock.runAll();
|
|
110
|
-
|
|
111
|
-
const newFlyoutParamName = mutatorWorkspace
|
|
112
|
-
.getFlyout()
|
|
113
|
-
.getWorkspace()
|
|
114
|
-
.getTopBlocks(true)[0]
|
|
115
|
-
.getFieldValue('NAME');
|
|
116
|
-
assert.notEqual(
|
|
117
|
-
newFlyoutParamName,
|
|
118
|
-
origFlyoutParamName,
|
|
119
|
-
'Expected the flyout param to have updated to not conflict',
|
|
120
|
-
);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
test('adding a parameter to the procedure updates procedure defs', async function () {
|
|
124
|
-
// Create a stack of container, parameter.
|
|
125
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
126
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
127
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
128
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
129
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
130
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
131
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
132
|
-
containerBlock
|
|
133
|
-
.getInput('STACK')
|
|
134
|
-
.connection.connect(paramBlock.previousConnection);
|
|
135
|
-
this.clock.runAll();
|
|
136
|
-
|
|
137
|
-
assert.isNotNull(
|
|
138
|
-
defBlock.getField('PARAMS'),
|
|
139
|
-
'Expected the params field to exist',
|
|
140
|
-
);
|
|
141
|
-
assert.isTrue(
|
|
142
|
-
defBlock.getFieldValue('PARAMS').includes('param1'),
|
|
143
|
-
'Expected the params field to contain the name of the new param',
|
|
144
|
-
);
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
test('adding a parameter to the procedure updates procedure callers', async function () {
|
|
148
|
-
// Create a stack of container, parameter.
|
|
149
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
150
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
151
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
152
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
153
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
154
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
155
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
156
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
157
|
-
containerBlock
|
|
158
|
-
.getInput('STACK')
|
|
159
|
-
.connection.connect(paramBlock.previousConnection);
|
|
160
|
-
this.clock.runAll();
|
|
161
|
-
|
|
162
|
-
assert.isNotNull(
|
|
163
|
-
callBlock.getInput('ARG0'),
|
|
164
|
-
'Expected the param input to exist',
|
|
165
|
-
);
|
|
166
|
-
assert.equal(
|
|
167
|
-
callBlock.getFieldValue('ARGNAME0'),
|
|
168
|
-
'param1',
|
|
169
|
-
'Expected the params field to match the name of the new param',
|
|
170
|
-
);
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
test('undoing adding a procedure parameter removes it', async function () {
|
|
174
|
-
// Create a stack of container, parameter.
|
|
175
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
176
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
177
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
178
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
179
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
180
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
181
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
182
|
-
containerBlock
|
|
183
|
-
.getInput('STACK')
|
|
184
|
-
.connection.connect(paramBlock.previousConnection);
|
|
185
|
-
this.clock.runAll();
|
|
186
|
-
|
|
187
|
-
this.workspace.undo();
|
|
188
|
-
|
|
189
|
-
assert.isFalse(
|
|
190
|
-
defBlock.getFieldValue('PARAMS').includes('param1'),
|
|
191
|
-
'Expected the params field to not contain the name of the new param',
|
|
192
|
-
);
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
test(
|
|
196
|
-
'undoing and redoing adding a procedure parameter maintains ' +
|
|
197
|
-
'the same state',
|
|
198
|
-
async function () {
|
|
199
|
-
// Create a stack of container, parameter.
|
|
200
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
201
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
202
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
203
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
204
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
205
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
206
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
207
|
-
containerBlock
|
|
208
|
-
.getInput('STACK')
|
|
209
|
-
.connection.connect(paramBlock.previousConnection);
|
|
210
|
-
this.clock.runAll();
|
|
211
|
-
|
|
212
|
-
this.workspace.undo();
|
|
213
|
-
this.workspace.undo(/* redo= */ true);
|
|
214
|
-
|
|
215
|
-
assert.isNotNull(
|
|
216
|
-
defBlock.getField('PARAMS'),
|
|
217
|
-
'Expected the params field to exist',
|
|
218
|
-
);
|
|
219
|
-
assert.isTrue(
|
|
220
|
-
defBlock.getFieldValue('PARAMS').includes('param1'),
|
|
221
|
-
'Expected the params field to contain the name of the new param',
|
|
222
|
-
);
|
|
223
|
-
},
|
|
224
|
-
);
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
suite('deleting procedure parameters', function () {
|
|
228
|
-
test('deleting a parameter from the procedure updates procedure defs', async function () {
|
|
229
|
-
// Create a stack of container, parameter.
|
|
230
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
231
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
232
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
233
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
234
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
235
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
236
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
237
|
-
containerBlock
|
|
238
|
-
.getInput('STACK')
|
|
239
|
-
.connection.connect(paramBlock.previousConnection);
|
|
240
|
-
this.clock.runAll();
|
|
241
|
-
|
|
242
|
-
paramBlock.checkAndDelete();
|
|
243
|
-
this.clock.runAll();
|
|
244
|
-
|
|
245
|
-
assert.isFalse(
|
|
246
|
-
defBlock.getFieldValue('PARAMS').includes('param1'),
|
|
247
|
-
'Expected the params field to not contain the name of the new param',
|
|
248
|
-
);
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
test('deleting a parameter from the procedure udpates procedure callers', async function () {
|
|
252
|
-
// Create a stack of container, parameter.
|
|
253
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
254
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
255
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
256
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
257
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
258
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
259
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
260
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
261
|
-
containerBlock
|
|
262
|
-
.getInput('STACK')
|
|
263
|
-
.connection.connect(paramBlock.previousConnection);
|
|
264
|
-
this.clock.runAll();
|
|
265
|
-
|
|
266
|
-
paramBlock.checkAndDelete();
|
|
267
|
-
this.clock.runAll();
|
|
268
|
-
|
|
269
|
-
assert.isNull(
|
|
270
|
-
callBlock.getInput('ARG0'),
|
|
271
|
-
'Expected the param input to not exist',
|
|
272
|
-
);
|
|
273
|
-
});
|
|
274
|
-
|
|
275
|
-
test('undoing deleting a procedure parameter adds it', async function () {
|
|
276
|
-
// Create a stack of container, parameter.
|
|
277
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
278
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
279
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
280
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
281
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
282
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
283
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
284
|
-
containerBlock
|
|
285
|
-
.getInput('STACK')
|
|
286
|
-
.connection.connect(paramBlock.previousConnection);
|
|
287
|
-
this.clock.runAll();
|
|
288
|
-
paramBlock.checkAndDelete();
|
|
289
|
-
this.clock.runAll();
|
|
290
|
-
|
|
291
|
-
this.workspace.undo();
|
|
292
|
-
|
|
293
|
-
assert.isTrue(
|
|
294
|
-
defBlock.getFieldValue('PARAMS').includes('param1'),
|
|
295
|
-
'Expected the params field to contain the name of the new param',
|
|
296
|
-
);
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
test(
|
|
300
|
-
'undoing and redoing deleting a procedure parameter maintains ' +
|
|
301
|
-
'the same state',
|
|
302
|
-
async function () {
|
|
303
|
-
// Create a stack of container, parameter.
|
|
304
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
305
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
306
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
307
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
308
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
309
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
310
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
311
|
-
containerBlock
|
|
312
|
-
.getInput('STACK')
|
|
313
|
-
.connection.connect(paramBlock.previousConnection);
|
|
314
|
-
this.clock.runAll();
|
|
315
|
-
paramBlock.checkAndDelete();
|
|
316
|
-
this.clock.runAll();
|
|
317
|
-
|
|
318
|
-
this.workspace.undo();
|
|
319
|
-
this.workspace.undo(/* redo= */ true);
|
|
320
|
-
|
|
321
|
-
assert.isFalse(
|
|
322
|
-
defBlock.getFieldValue('PARAMS').includes('param1'),
|
|
323
|
-
'Expected the params field to not contain the name of the new param',
|
|
324
|
-
);
|
|
325
|
-
},
|
|
326
|
-
);
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
suite('renaming procedure parameters', function () {
|
|
330
|
-
test('defs are updated for parameter renames', async function () {
|
|
331
|
-
// Create a stack of container, parameter.
|
|
332
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
333
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
334
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
335
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
336
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
337
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
338
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
339
|
-
containerBlock
|
|
340
|
-
.getInput('STACK')
|
|
341
|
-
.connection.connect(paramBlock.previousConnection);
|
|
342
|
-
this.clock.runAll();
|
|
343
|
-
|
|
344
|
-
paramBlock.setFieldValue('new name', 'NAME');
|
|
345
|
-
this.clock.runAll();
|
|
346
|
-
|
|
347
|
-
assert.isNotNull(
|
|
348
|
-
defBlock.getField('PARAMS'),
|
|
349
|
-
'Expected the params field to exist',
|
|
350
|
-
);
|
|
351
|
-
assert.isTrue(
|
|
352
|
-
defBlock.getFieldValue('PARAMS').includes('new name'),
|
|
353
|
-
'Expected the params field to contain the new name of the param',
|
|
354
|
-
);
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
test('defs are updated for parameter renames when two params exist', async function () {
|
|
358
|
-
// Create a stack of container, parameter.
|
|
359
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
360
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
361
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
362
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
363
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
364
|
-
const paramBlock1 = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
365
|
-
paramBlock1.setFieldValue('param1', 'NAME');
|
|
366
|
-
const paramBlock2 = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
367
|
-
paramBlock2.setFieldValue('param2', 'NAME');
|
|
368
|
-
containerBlock
|
|
369
|
-
.getInput('STACK')
|
|
370
|
-
.connection.connect(paramBlock1.previousConnection);
|
|
371
|
-
paramBlock1.nextConnection.connect(paramBlock2.previousConnection);
|
|
372
|
-
this.clock.runAll();
|
|
373
|
-
|
|
374
|
-
paramBlock1.setFieldValue('new name', 'NAME');
|
|
375
|
-
this.clock.runAll();
|
|
376
|
-
|
|
377
|
-
assert.isNotNull(
|
|
378
|
-
defBlock.getField('PARAMS'),
|
|
379
|
-
'Expected the params field to exist',
|
|
380
|
-
);
|
|
381
|
-
assert.isTrue(
|
|
382
|
-
defBlock.getFieldValue('PARAMS').includes('new name'),
|
|
383
|
-
'Expected the params field to contain the new name of the param',
|
|
384
|
-
);
|
|
385
|
-
});
|
|
386
|
-
|
|
387
|
-
test('callers are updated for parameter renames', async function () {
|
|
388
|
-
// Create a stack of container, parameter.
|
|
389
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
390
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
391
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
392
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
393
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
394
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
395
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
396
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
397
|
-
containerBlock
|
|
398
|
-
.getInput('STACK')
|
|
399
|
-
.connection.connect(paramBlock.previousConnection);
|
|
400
|
-
this.clock.runAll();
|
|
401
|
-
|
|
402
|
-
paramBlock.setFieldValue('new name', 'NAME');
|
|
403
|
-
this.clock.runAll();
|
|
404
|
-
|
|
405
|
-
assert.isNotNull(
|
|
406
|
-
callBlock.getInput('ARG0'),
|
|
407
|
-
'Expected the param input to exist',
|
|
408
|
-
);
|
|
409
|
-
assert.equal(
|
|
410
|
-
callBlock.getFieldValue('ARGNAME0'),
|
|
411
|
-
'new name',
|
|
412
|
-
'Expected the params field to match the name of the new param',
|
|
413
|
-
);
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
test('variables associated with procedure parameters are not renamed', async function () {
|
|
417
|
-
// Create a stack of container, parameter.
|
|
418
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
419
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
420
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
421
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
422
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
423
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
424
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
425
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
426
|
-
containerBlock
|
|
427
|
-
.getInput('STACK')
|
|
428
|
-
.connection.connect(paramBlock.previousConnection);
|
|
429
|
-
this.clock.runAll();
|
|
430
|
-
|
|
431
|
-
paramBlock.setFieldValue('param2', 'NAME');
|
|
432
|
-
this.clock.runAll();
|
|
433
|
-
|
|
434
|
-
assert.isNotNull(
|
|
435
|
-
this.workspace.getVariable('param1', ''),
|
|
436
|
-
'Expected the old variable to continue to exist',
|
|
437
|
-
);
|
|
438
|
-
});
|
|
439
|
-
|
|
440
|
-
test('renaming a variable associated with a parameter updates procedure defs', async function () {
|
|
441
|
-
// Create a stack of container, parameter.
|
|
442
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
443
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
444
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
445
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
446
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
447
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
448
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
449
|
-
containerBlock
|
|
450
|
-
.getInput('STACK')
|
|
451
|
-
.connection.connect(paramBlock.previousConnection);
|
|
452
|
-
this.clock.runAll();
|
|
453
|
-
mutatorIcon.setBubbleVisible(false);
|
|
454
|
-
|
|
455
|
-
const variable = this.workspace.getVariable('param1', '');
|
|
456
|
-
this.workspace.renameVariableById(variable.getId(), 'new name');
|
|
457
|
-
|
|
458
|
-
assert.isNotNull(
|
|
459
|
-
defBlock.getField('PARAMS'),
|
|
460
|
-
'Expected the params field to exist',
|
|
461
|
-
);
|
|
462
|
-
assert.isTrue(
|
|
463
|
-
defBlock.getFieldValue('PARAMS').includes('new name'),
|
|
464
|
-
'Expected the params field to contain the new name of the param',
|
|
465
|
-
);
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
test('renaming a variable associated with a parameter updates mutator parameters', async function () {
|
|
469
|
-
// Create a stack of container, parameter.
|
|
470
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
471
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
472
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
473
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
474
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
475
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
476
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
477
|
-
containerBlock
|
|
478
|
-
.getInput('STACK')
|
|
479
|
-
.connection.connect(paramBlock.previousConnection);
|
|
480
|
-
this.clock.runAll();
|
|
481
|
-
|
|
482
|
-
const variable = this.workspace.getVariable('param1', '');
|
|
483
|
-
this.workspace.renameVariableById(variable.getId(), 'new name');
|
|
484
|
-
|
|
485
|
-
assert.equal(
|
|
486
|
-
paramBlock.getFieldValue('NAME'),
|
|
487
|
-
'new name',
|
|
488
|
-
'Expected the params field to contain the new name of the param',
|
|
489
|
-
);
|
|
490
|
-
});
|
|
491
|
-
|
|
492
|
-
test('renaming a variable associated with a parameter updates procedure callers', async function () {
|
|
493
|
-
// Create a stack of container, parameter.
|
|
494
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
495
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
496
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
497
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
498
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
499
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
500
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
501
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
502
|
-
containerBlock
|
|
503
|
-
.getInput('STACK')
|
|
504
|
-
.connection.connect(paramBlock.previousConnection);
|
|
505
|
-
this.clock.runAll();
|
|
506
|
-
mutatorIcon.setBubbleVisible(false);
|
|
507
|
-
|
|
508
|
-
const variable = this.workspace.getVariable('param1', '');
|
|
509
|
-
this.workspace.renameVariableById(variable.getId(), 'new name');
|
|
510
|
-
|
|
511
|
-
assert.isNotNull(
|
|
512
|
-
callBlock.getInput('ARG0'),
|
|
513
|
-
'Expected the param input to exist',
|
|
514
|
-
);
|
|
515
|
-
assert.equal(
|
|
516
|
-
callBlock.getFieldValue('ARGNAME0'),
|
|
517
|
-
'new name',
|
|
518
|
-
'Expected the params field to match the name of the new param',
|
|
519
|
-
);
|
|
520
|
-
});
|
|
521
|
-
|
|
522
|
-
test('coalescing a variable associated with a parameter updates procedure defs', async function () {
|
|
523
|
-
// Create a stack of container, parameter.
|
|
524
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
525
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
526
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
527
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
528
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
529
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
530
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
531
|
-
containerBlock
|
|
532
|
-
.getInput('STACK')
|
|
533
|
-
.connection.connect(paramBlock.previousConnection);
|
|
534
|
-
this.clock.runAll();
|
|
535
|
-
mutatorIcon.setBubbleVisible(false);
|
|
536
|
-
|
|
537
|
-
const variable = this.workspace.getVariable('param1', '');
|
|
538
|
-
this.workspace.renameVariableById(variable.getId(), 'preCreatedVar');
|
|
539
|
-
|
|
540
|
-
assert.isNotNull(
|
|
541
|
-
defBlock.getField('PARAMS'),
|
|
542
|
-
'Expected the params field to exist',
|
|
543
|
-
);
|
|
544
|
-
assert.isTrue(
|
|
545
|
-
defBlock.getFieldValue('PARAMS').includes('preCreatedVar'),
|
|
546
|
-
'Expected the params field to contain the new name of the param',
|
|
547
|
-
);
|
|
548
|
-
});
|
|
549
|
-
|
|
550
|
-
test('coalescing a variable associated with a parameter updates mutator parameters', async function () {
|
|
551
|
-
// Create a stack of container, parameter.
|
|
552
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
553
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
554
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
555
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
556
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
557
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
558
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
559
|
-
containerBlock
|
|
560
|
-
.getInput('STACK')
|
|
561
|
-
.connection.connect(paramBlock.previousConnection);
|
|
562
|
-
this.clock.runAll();
|
|
563
|
-
|
|
564
|
-
const variable = this.workspace.getVariable('param1', '');
|
|
565
|
-
this.workspace.renameVariableById(variable.getId(), 'preCreatedVar');
|
|
566
|
-
|
|
567
|
-
assert.equal(
|
|
568
|
-
paramBlock.getFieldValue('NAME'),
|
|
569
|
-
'preCreatedVar',
|
|
570
|
-
'Expected the params field to contain the new name of the param',
|
|
571
|
-
);
|
|
572
|
-
});
|
|
573
|
-
|
|
574
|
-
test('coalescing a variable associated with a parameter updates procedure callers', async function () {
|
|
575
|
-
// Create a stack of container, parameter.
|
|
576
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
577
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
578
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
579
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
580
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
581
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
582
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
583
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
584
|
-
containerBlock
|
|
585
|
-
.getInput('STACK')
|
|
586
|
-
.connection.connect(paramBlock.previousConnection);
|
|
587
|
-
this.clock.runAll();
|
|
588
|
-
mutatorIcon.setBubbleVisible(false);
|
|
589
|
-
|
|
590
|
-
const variable = this.workspace.getVariable('param1', '');
|
|
591
|
-
this.workspace.renameVariableById(variable.getId(), 'preCreatedVar');
|
|
592
|
-
|
|
593
|
-
assert.isNotNull(
|
|
594
|
-
callBlock.getInput('ARG0'),
|
|
595
|
-
'Expected the param input to exist',
|
|
596
|
-
);
|
|
597
|
-
assert.equal(
|
|
598
|
-
callBlock.getFieldValue('ARGNAME0'),
|
|
599
|
-
'preCreatedVar',
|
|
600
|
-
'Expected the params field to match the name of the new param',
|
|
601
|
-
);
|
|
602
|
-
});
|
|
603
|
-
|
|
604
|
-
test.skip(
|
|
605
|
-
'renaming a variable such that you get a parameter ' +
|
|
606
|
-
'conflict does... something!',
|
|
607
|
-
function () {},
|
|
608
|
-
);
|
|
609
|
-
|
|
610
|
-
test('undoing renaming a procedure parameter reverts the change', async function () {
|
|
611
|
-
// Create a stack of container, parameter.
|
|
612
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
613
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
614
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
615
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
616
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
617
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
618
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
619
|
-
containerBlock
|
|
620
|
-
.getInput('STACK')
|
|
621
|
-
.connection.connect(paramBlock.previousConnection);
|
|
622
|
-
this.clock.runAll();
|
|
623
|
-
Blockly.Events.setGroup(true);
|
|
624
|
-
paramBlock.setFieldValue('n', 'NAME');
|
|
625
|
-
this.clock.runAll();
|
|
626
|
-
paramBlock.setFieldValue('ne', 'NAME');
|
|
627
|
-
this.clock.runAll();
|
|
628
|
-
paramBlock.setFieldValue('new', 'NAME');
|
|
629
|
-
this.clock.runAll();
|
|
630
|
-
Blockly.Events.setGroup(false);
|
|
631
|
-
|
|
632
|
-
this.workspace.undo();
|
|
633
|
-
this.clock.runAll();
|
|
634
|
-
|
|
635
|
-
assert.isTrue(
|
|
636
|
-
defBlock.getFieldValue('PARAMS').includes('param1'),
|
|
637
|
-
'Expected the params field to contain the old name of the param',
|
|
638
|
-
);
|
|
639
|
-
});
|
|
640
|
-
|
|
641
|
-
test('undoing and redoing renaming a procedure maintains the same state', async function () {
|
|
642
|
-
// Create a stack of container, parameter.
|
|
643
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
644
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
645
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
646
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
647
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
648
|
-
const paramBlock = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
649
|
-
paramBlock.setFieldValue('param1', 'NAME');
|
|
650
|
-
containerBlock
|
|
651
|
-
.getInput('STACK')
|
|
652
|
-
.connection.connect(paramBlock.previousConnection);
|
|
653
|
-
this.clock.runAll();
|
|
654
|
-
Blockly.Events.setGroup(true);
|
|
655
|
-
paramBlock.setFieldValue('n', 'NAME');
|
|
656
|
-
this.clock.runAll();
|
|
657
|
-
paramBlock.setFieldValue('ne', 'NAME');
|
|
658
|
-
this.clock.runAll();
|
|
659
|
-
paramBlock.setFieldValue('new', 'NAME');
|
|
660
|
-
this.clock.runAll();
|
|
661
|
-
Blockly.Events.setGroup(false);
|
|
662
|
-
|
|
663
|
-
this.workspace.undo();
|
|
664
|
-
this.workspace.undo(/* redo= */ true);
|
|
665
|
-
|
|
666
|
-
assert.isTrue(
|
|
667
|
-
defBlock.getFieldValue('PARAMS').includes('new'),
|
|
668
|
-
'Expected the params field to contain the new name of the param',
|
|
669
|
-
);
|
|
670
|
-
});
|
|
671
|
-
});
|
|
672
|
-
|
|
673
|
-
suite('reordering procedure parameters', function () {
|
|
674
|
-
test('reordering procedure parameters updates procedure blocks', async function () {
|
|
675
|
-
// Create a stack of container, parameter, parameter.
|
|
676
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
677
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
678
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
679
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
680
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
681
|
-
const paramBlock1 = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
682
|
-
paramBlock1.setFieldValue('param1', 'NAME');
|
|
683
|
-
const paramBlock2 = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
684
|
-
paramBlock2.setFieldValue('param2', 'NAME');
|
|
685
|
-
containerBlock
|
|
686
|
-
.getInput('STACK')
|
|
687
|
-
.connection.connect(paramBlock1.previousConnection);
|
|
688
|
-
paramBlock1.nextConnection.connect(paramBlock2.previousConnection);
|
|
689
|
-
this.clock.runAll();
|
|
690
|
-
|
|
691
|
-
// Reorder the parameters.
|
|
692
|
-
paramBlock2.previousConnection.disconnect();
|
|
693
|
-
paramBlock1.previousConnection.disconnect();
|
|
694
|
-
containerBlock
|
|
695
|
-
.getInput('STACK')
|
|
696
|
-
.connection.connect(paramBlock2.previousConnection);
|
|
697
|
-
paramBlock2.nextConnection.connect(paramBlock1.previousConnection);
|
|
698
|
-
this.clock.runAll();
|
|
699
|
-
|
|
700
|
-
assert.isNotNull(
|
|
701
|
-
defBlock.getField('PARAMS'),
|
|
702
|
-
'Expected the params field to exist',
|
|
703
|
-
);
|
|
704
|
-
assert.isTrue(
|
|
705
|
-
defBlock.getFieldValue('PARAMS').includes('param2, param1'),
|
|
706
|
-
'Expected the params field order to match the parameter order',
|
|
707
|
-
);
|
|
708
|
-
});
|
|
709
|
-
|
|
710
|
-
test('reordering procedure parameters updates caller blocks', async function () {
|
|
711
|
-
// Create a stack of container, parameter, parameter.
|
|
712
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
713
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
714
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
715
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
716
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
717
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
718
|
-
const paramBlock1 = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
719
|
-
paramBlock1.setFieldValue('param1', 'NAME');
|
|
720
|
-
const paramBlock2 = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
721
|
-
paramBlock2.setFieldValue('param2', 'NAME');
|
|
722
|
-
containerBlock
|
|
723
|
-
.getInput('STACK')
|
|
724
|
-
.connection.connect(paramBlock1.previousConnection);
|
|
725
|
-
paramBlock1.nextConnection.connect(paramBlock2.previousConnection);
|
|
726
|
-
this.clock.runAll();
|
|
727
|
-
|
|
728
|
-
// Reorder the parameters.
|
|
729
|
-
paramBlock2.previousConnection.disconnect();
|
|
730
|
-
paramBlock1.previousConnection.disconnect();
|
|
731
|
-
containerBlock
|
|
732
|
-
.getInput('STACK')
|
|
733
|
-
.connection.connect(paramBlock2.previousConnection);
|
|
734
|
-
paramBlock2.nextConnection.connect(paramBlock1.previousConnection);
|
|
735
|
-
this.clock.runAll();
|
|
736
|
-
|
|
737
|
-
assert.isNotNull(
|
|
738
|
-
callBlock.getInput('ARG0'),
|
|
739
|
-
'Expected the param input to exist',
|
|
740
|
-
);
|
|
741
|
-
assert.equal(
|
|
742
|
-
callBlock.getFieldValue('ARGNAME0'),
|
|
743
|
-
'param2',
|
|
744
|
-
'Expected the params field to match the name of the second param',
|
|
745
|
-
);
|
|
746
|
-
assert.isNotNull(
|
|
747
|
-
callBlock.getInput('ARG1'),
|
|
748
|
-
'Expected the param input to exist',
|
|
749
|
-
);
|
|
750
|
-
assert.equal(
|
|
751
|
-
callBlock.getFieldValue('ARGNAME1'),
|
|
752
|
-
'param1',
|
|
753
|
-
'Expected the params field to match the name of the first param',
|
|
754
|
-
);
|
|
755
|
-
});
|
|
756
|
-
|
|
757
|
-
test(
|
|
758
|
-
'reordering procedure parameters reorders the blocks ' +
|
|
759
|
-
'attached to caller inputs',
|
|
760
|
-
async function () {
|
|
761
|
-
// Create a stack of container, parameter, parameter.
|
|
762
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
763
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
764
|
-
const mutatorIcon = defBlock.getIcon(Blockly.icons.MutatorIcon.TYPE);
|
|
765
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
766
|
-
const mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
767
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
768
|
-
const paramBlock1 = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
769
|
-
paramBlock1.setFieldValue('param1', 'NAME');
|
|
770
|
-
const paramBlock2 = mutatorWorkspace.newBlock('procedures_mutatorarg');
|
|
771
|
-
paramBlock2.setFieldValue('param2', 'NAME');
|
|
772
|
-
containerBlock
|
|
773
|
-
.getInput('STACK')
|
|
774
|
-
.connection.connect(paramBlock1.previousConnection);
|
|
775
|
-
paramBlock1.nextConnection.connect(paramBlock2.previousConnection);
|
|
776
|
-
this.clock.runAll();
|
|
777
|
-
|
|
778
|
-
// Add args to the parameter inputs on the caller.
|
|
779
|
-
const block1 = this.workspace.newBlock('text');
|
|
780
|
-
const block2 = this.workspace.newBlock('text');
|
|
781
|
-
callBlock.getInput('ARG0').connection.connect(block1.outputConnection);
|
|
782
|
-
callBlock.getInput('ARG1').connection.connect(block2.outputConnection);
|
|
783
|
-
|
|
784
|
-
// Reorder the parameters.
|
|
785
|
-
paramBlock2.previousConnection.disconnect();
|
|
786
|
-
paramBlock1.previousConnection.disconnect();
|
|
787
|
-
containerBlock
|
|
788
|
-
.getInput('STACK')
|
|
789
|
-
.connection.connect(paramBlock2.previousConnection);
|
|
790
|
-
paramBlock2.nextConnection.connect(paramBlock1.previousConnection);
|
|
791
|
-
this.clock.runAll();
|
|
792
|
-
|
|
793
|
-
assert.equal(
|
|
794
|
-
callBlock.getInputTargetBlock('ARG0'),
|
|
795
|
-
block2,
|
|
796
|
-
'Expected the second block to be in the first slot',
|
|
797
|
-
);
|
|
798
|
-
assert.equal(
|
|
799
|
-
callBlock.getInputTargetBlock('ARG1'),
|
|
800
|
-
block1,
|
|
801
|
-
'Expected the first block to be in the second slot',
|
|
802
|
-
);
|
|
803
|
-
},
|
|
804
|
-
);
|
|
805
|
-
});
|
|
806
|
-
|
|
807
|
-
suite('enabling and disabling procedure blocks', function () {
|
|
808
|
-
test(
|
|
809
|
-
'if a procedure definition is disabled, the procedure caller ' +
|
|
810
|
-
'is also disabled',
|
|
811
|
-
function () {
|
|
812
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
813
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
814
|
-
|
|
815
|
-
defBlock.setDisabledReason(true, 'MANUALLY_DISABLED');
|
|
816
|
-
this.clock.runAll();
|
|
817
|
-
|
|
818
|
-
assert.isFalse(
|
|
819
|
-
callBlock.isEnabled(),
|
|
820
|
-
'Expected the caller block to be disabled',
|
|
821
|
-
);
|
|
822
|
-
},
|
|
823
|
-
);
|
|
824
|
-
|
|
825
|
-
test(
|
|
826
|
-
'if a procedure definition is invalid, the procedure caller ' +
|
|
827
|
-
'is also invalid',
|
|
828
|
-
function () {
|
|
829
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
830
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
831
|
-
|
|
832
|
-
defBlock.setDisabledReason(true, 'test reason');
|
|
833
|
-
this.clock.runAll();
|
|
834
|
-
|
|
835
|
-
assert.isFalse(
|
|
836
|
-
callBlock.isEnabled(),
|
|
837
|
-
'Expected the caller block to be invalid',
|
|
838
|
-
);
|
|
839
|
-
},
|
|
840
|
-
);
|
|
841
|
-
|
|
842
|
-
test(
|
|
843
|
-
'if a procedure definition is enabled, the procedure caller ' +
|
|
844
|
-
'is also enabled',
|
|
845
|
-
function () {
|
|
846
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
847
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
848
|
-
defBlock.setDisabledReason(true, 'MANUALLY_DISABLED');
|
|
849
|
-
this.clock.runAll();
|
|
850
|
-
|
|
851
|
-
defBlock.setDisabledReason(false, 'MANUALLY_DISABLED');
|
|
852
|
-
this.clock.runAll();
|
|
853
|
-
|
|
854
|
-
assert.isTrue(
|
|
855
|
-
callBlock.isEnabled(),
|
|
856
|
-
'Expected the caller block to be enabled',
|
|
857
|
-
);
|
|
858
|
-
},
|
|
859
|
-
);
|
|
860
|
-
|
|
861
|
-
test(
|
|
862
|
-
'if a procedure caller block was already disabled before ' +
|
|
863
|
-
'its definition was disabled, it is not reenabled',
|
|
864
|
-
function () {
|
|
865
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
866
|
-
const callBlock = createProcCallBlock(this.workspace);
|
|
867
|
-
this.clock.runAll();
|
|
868
|
-
callBlock.setDisabledReason(true, 'MANUALLY_DISABLED');
|
|
869
|
-
this.clock.runAll();
|
|
870
|
-
defBlock.setDisabledReason(true, 'MANUALLY_DISABLED');
|
|
871
|
-
this.clock.runAll();
|
|
872
|
-
|
|
873
|
-
defBlock.setDisabledReason(false, 'MANUALLY_DISABLED');
|
|
874
|
-
this.clock.runAll();
|
|
875
|
-
|
|
876
|
-
assert.isFalse(
|
|
877
|
-
callBlock.isEnabled(),
|
|
878
|
-
'Expected the caller block to continue to be disabled',
|
|
879
|
-
);
|
|
880
|
-
},
|
|
881
|
-
);
|
|
882
|
-
});
|
|
883
|
-
|
|
884
|
-
suite('procedures_ifreturn blocks', function () {
|
|
885
|
-
test('ifreturn block is invalid outside of def block', function () {
|
|
886
|
-
const ifreturnBlock = Blockly.serialization.blocks.append(
|
|
887
|
-
{'type': 'procedures_ifreturn'},
|
|
888
|
-
this.workspace,
|
|
889
|
-
);
|
|
890
|
-
this.clock.runAll();
|
|
891
|
-
assert.isFalse(
|
|
892
|
-
ifreturnBlock.isEnabled(),
|
|
893
|
-
'Expected the ifreturn block to be invalid',
|
|
894
|
-
);
|
|
895
|
-
});
|
|
896
|
-
|
|
897
|
-
test('ifreturn block is valid inside of def block', function () {
|
|
898
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
899
|
-
const ifreturnBlock = Blockly.serialization.blocks.append(
|
|
900
|
-
{'type': 'procedures_ifreturn'},
|
|
901
|
-
this.workspace,
|
|
902
|
-
);
|
|
903
|
-
defBlock
|
|
904
|
-
.getInput('STACK')
|
|
905
|
-
.connection.connect(ifreturnBlock.previousConnection);
|
|
906
|
-
this.clock.runAll();
|
|
907
|
-
assert.isTrue(
|
|
908
|
-
ifreturnBlock.isEnabled(),
|
|
909
|
-
'Expected the ifreturn block to be valid',
|
|
910
|
-
);
|
|
911
|
-
});
|
|
912
|
-
});
|
|
913
|
-
|
|
914
|
-
suite('deleting procedure blocks', function () {
|
|
915
|
-
test(
|
|
916
|
-
'when the procedure definition block is deleted, all of its ' +
|
|
917
|
-
'associated callers are deleted as well',
|
|
918
|
-
function () {
|
|
919
|
-
const defBlock = createProcDefBlock(this.workspace);
|
|
920
|
-
const callBlock1 = createProcCallBlock(this.workspace);
|
|
921
|
-
const callBlock2 = createProcCallBlock(this.workspace);
|
|
922
|
-
|
|
923
|
-
this.clock.runAll();
|
|
924
|
-
defBlock.dispose();
|
|
925
|
-
this.clock.runAll();
|
|
926
|
-
|
|
927
|
-
assert.isTrue(
|
|
928
|
-
callBlock1.disposed,
|
|
929
|
-
'Expected the first caller to be disposed',
|
|
930
|
-
);
|
|
931
|
-
assert.isTrue(
|
|
932
|
-
callBlock2.disposed,
|
|
933
|
-
'Expected the second caller to be disposed',
|
|
934
|
-
);
|
|
935
|
-
},
|
|
936
|
-
);
|
|
937
|
-
});
|
|
938
|
-
|
|
939
|
-
suite('caller blocks creating new def blocks', function () {
|
|
940
|
-
setup(function () {
|
|
941
|
-
this.TEST_VAR_ID = 'test-id';
|
|
942
|
-
this.genUidStub = createGenUidStubWithReturns(this.TEST_VAR_ID);
|
|
943
|
-
});
|
|
944
|
-
|
|
945
|
-
suite('xml', function () {
|
|
946
|
-
test('callers without defs create new defs', function () {
|
|
947
|
-
const callBlock = Blockly.Xml.domToBlock(
|
|
948
|
-
Blockly.utils.xml.textToDom(`
|
|
949
|
-
<block type="procedures_callreturn">
|
|
950
|
-
<mutation name="do something"/>
|
|
951
|
-
</block>`),
|
|
952
|
-
this.workspace,
|
|
953
|
-
);
|
|
954
|
-
this.clock.runAll();
|
|
955
|
-
assertDefBlockStructure(
|
|
956
|
-
this.workspace.getBlocksByType('procedures_defreturn')[0],
|
|
957
|
-
true,
|
|
958
|
-
);
|
|
959
|
-
assertCallBlockStructure(callBlock, [], [], 'do something');
|
|
960
|
-
});
|
|
961
|
-
|
|
962
|
-
test('callers without mutations create unnamed defs', function () {
|
|
963
|
-
const callBlock = Blockly.Xml.domToBlock(
|
|
964
|
-
Blockly.utils.xml.textToDom(
|
|
965
|
-
'<block type="procedures_callreturn"></block>',
|
|
966
|
-
),
|
|
967
|
-
this.workspace,
|
|
968
|
-
);
|
|
969
|
-
this.clock.runAll();
|
|
970
|
-
assertDefBlockStructure(
|
|
971
|
-
this.workspace.getBlocksByType('procedures_defreturn')[0],
|
|
972
|
-
true,
|
|
973
|
-
);
|
|
974
|
-
assertCallBlockStructure(callBlock, [], [], 'unnamed');
|
|
975
|
-
});
|
|
976
|
-
|
|
977
|
-
test('callers with missing args create new defs', function () {
|
|
978
|
-
const defBlock = Blockly.Xml.domToBlock(
|
|
979
|
-
Blockly.utils.xml.textToDom(`
|
|
980
|
-
<block type="procedures_defreturn">
|
|
981
|
-
<field name="NAME">do something</field>
|
|
982
|
-
<mutation>
|
|
983
|
-
<arg name="x" varid="arg"></arg>
|
|
984
|
-
</mutation>
|
|
985
|
-
</block>
|
|
986
|
-
`),
|
|
987
|
-
this.workspace,
|
|
988
|
-
);
|
|
989
|
-
const callBlock = Blockly.Xml.domToBlock(
|
|
990
|
-
Blockly.utils.xml.textToDom(
|
|
991
|
-
'<block type="procedures_callreturn">' +
|
|
992
|
-
' <mutation name="do something"/>' +
|
|
993
|
-
'</block>',
|
|
994
|
-
),
|
|
995
|
-
this.workspace,
|
|
996
|
-
);
|
|
997
|
-
this.clock.runAll();
|
|
998
|
-
assertDefBlockStructure(defBlock, true, ['x'], ['arg']);
|
|
999
|
-
assertCallBlockStructure(callBlock, [], [], 'do something2');
|
|
1000
|
-
});
|
|
1001
|
-
|
|
1002
|
-
test('callers with mismatched args create new defs', function () {
|
|
1003
|
-
const defBlock = Blockly.Xml.domToBlock(
|
|
1004
|
-
Blockly.utils.xml.textToDom(`
|
|
1005
|
-
<block type="procedures_defreturn">
|
|
1006
|
-
<field name="NAME">do something</field>
|
|
1007
|
-
<mutation>
|
|
1008
|
-
<arg name="x" varid="arg"></arg>
|
|
1009
|
-
</mutation>
|
|
1010
|
-
</block>
|
|
1011
|
-
`),
|
|
1012
|
-
this.workspace,
|
|
1013
|
-
);
|
|
1014
|
-
const callBlock = Blockly.Xml.domToBlock(
|
|
1015
|
-
Blockly.utils.xml.textToDom(`
|
|
1016
|
-
<block type="procedures_callreturn">
|
|
1017
|
-
<mutation name="do something">
|
|
1018
|
-
<arg name="y"></arg>
|
|
1019
|
-
</mutation>
|
|
1020
|
-
</block>
|
|
1021
|
-
`),
|
|
1022
|
-
this.workspace,
|
|
1023
|
-
);
|
|
1024
|
-
this.clock.runAll();
|
|
1025
|
-
assertDefBlockStructure(defBlock, true, ['x'], ['arg']);
|
|
1026
|
-
assertCallBlockStructure(
|
|
1027
|
-
callBlock,
|
|
1028
|
-
['y'],
|
|
1029
|
-
[this.TEST_VAR_ID],
|
|
1030
|
-
'do something2',
|
|
1031
|
-
);
|
|
1032
|
-
});
|
|
1033
|
-
|
|
1034
|
-
test.skip('callers whose defs are deserialized later do not create defs', function () {
|
|
1035
|
-
Blockly.Xml.domToWorkspace(
|
|
1036
|
-
Blockly.utils.xml.textToDom(`
|
|
1037
|
-
<xml>
|
|
1038
|
-
<block type="procedures_callreturn">
|
|
1039
|
-
<mutation name="do something">
|
|
1040
|
-
<arg name="x"></arg>
|
|
1041
|
-
</mutation>
|
|
1042
|
-
</block>
|
|
1043
|
-
<block type="procedures_defreturn">
|
|
1044
|
-
<field name="NAME">do something</field>
|
|
1045
|
-
<mutation>
|
|
1046
|
-
<arg name="x" varid="arg"></arg>
|
|
1047
|
-
</mutation>
|
|
1048
|
-
</block>
|
|
1049
|
-
</xml>
|
|
1050
|
-
`),
|
|
1051
|
-
this.workspace,
|
|
1052
|
-
);
|
|
1053
|
-
this.clock.runAll();
|
|
1054
|
-
const defBlock = this.workspace.getBlocksByType(
|
|
1055
|
-
'procedures_defreturn',
|
|
1056
|
-
)[0];
|
|
1057
|
-
const callBlock = this.workspace.getBlocksByType(
|
|
1058
|
-
'procedures_callreturn',
|
|
1059
|
-
)[0];
|
|
1060
|
-
// TODO: Currently the callers are creating variables with different
|
|
1061
|
-
// IDs than those serialized to XML, so these assertions fail.
|
|
1062
|
-
assertDefBlockStructure(defBlock, true, ['x'], ['arg']);
|
|
1063
|
-
assertCallBlockStructure(callBlock, ['x'], ['arg'], 'do something');
|
|
1064
|
-
});
|
|
1065
|
-
});
|
|
1066
|
-
|
|
1067
|
-
suite('json', function () {
|
|
1068
|
-
test('callers without defs create new defs', function () {
|
|
1069
|
-
const callBlock = Blockly.serialization.blocks.append(
|
|
1070
|
-
{
|
|
1071
|
-
'type': 'procedures_callreturn',
|
|
1072
|
-
'extraState': {
|
|
1073
|
-
'name': 'do something',
|
|
1074
|
-
},
|
|
1075
|
-
},
|
|
1076
|
-
this.workspace,
|
|
1077
|
-
{recordUndo: true},
|
|
1078
|
-
);
|
|
1079
|
-
this.clock.runAll();
|
|
1080
|
-
assertDefBlockStructure(
|
|
1081
|
-
this.workspace.getBlocksByType('procedures_defreturn')[0],
|
|
1082
|
-
true,
|
|
1083
|
-
);
|
|
1084
|
-
assertCallBlockStructure(callBlock, [], [], 'do something');
|
|
1085
|
-
});
|
|
1086
|
-
|
|
1087
|
-
test('callers without extra state create unamed defs', function () {
|
|
1088
|
-
// recordUndo must be true to trigger change listener.
|
|
1089
|
-
const callBlock = Blockly.serialization.blocks.append(
|
|
1090
|
-
{
|
|
1091
|
-
'type': 'procedures_callreturn',
|
|
1092
|
-
},
|
|
1093
|
-
this.workspace,
|
|
1094
|
-
{recordUndo: true},
|
|
1095
|
-
);
|
|
1096
|
-
this.clock.runAll();
|
|
1097
|
-
assertDefBlockStructure(
|
|
1098
|
-
this.workspace.getBlocksByType('procedures_defreturn')[0],
|
|
1099
|
-
true,
|
|
1100
|
-
);
|
|
1101
|
-
assertCallBlockStructure(callBlock, [], [], 'unnamed');
|
|
1102
|
-
});
|
|
1103
|
-
|
|
1104
|
-
test('callers with missing args create new defs', function () {
|
|
1105
|
-
const defBlock = Blockly.serialization.blocks.append(
|
|
1106
|
-
{
|
|
1107
|
-
'type': 'procedures_defreturn',
|
|
1108
|
-
'fields': {
|
|
1109
|
-
'NAME': 'do something',
|
|
1110
|
-
},
|
|
1111
|
-
'extraState': {
|
|
1112
|
-
'params': [
|
|
1113
|
-
{
|
|
1114
|
-
'name': 'x',
|
|
1115
|
-
'id': 'arg',
|
|
1116
|
-
},
|
|
1117
|
-
],
|
|
1118
|
-
},
|
|
1119
|
-
},
|
|
1120
|
-
this.workspace,
|
|
1121
|
-
);
|
|
1122
|
-
const callBlock = Blockly.serialization.blocks.append(
|
|
1123
|
-
{
|
|
1124
|
-
'type': 'procedures_callreturn',
|
|
1125
|
-
'extraState': {
|
|
1126
|
-
'name': 'do something',
|
|
1127
|
-
},
|
|
1128
|
-
},
|
|
1129
|
-
this.workspace,
|
|
1130
|
-
{recordUndo: true},
|
|
1131
|
-
);
|
|
1132
|
-
this.clock.runAll();
|
|
1133
|
-
assertDefBlockStructure(defBlock, true, ['x'], ['arg']);
|
|
1134
|
-
assertCallBlockStructure(callBlock, [], [], 'do something2');
|
|
1135
|
-
});
|
|
1136
|
-
|
|
1137
|
-
test('callers with mismatched args create new defs', function () {
|
|
1138
|
-
const defBlock = Blockly.serialization.blocks.append(
|
|
1139
|
-
{
|
|
1140
|
-
'type': 'procedures_defreturn',
|
|
1141
|
-
'fields': {
|
|
1142
|
-
'NAME': 'do something',
|
|
1143
|
-
},
|
|
1144
|
-
'extraState': {
|
|
1145
|
-
'params': [
|
|
1146
|
-
{
|
|
1147
|
-
'name': 'x',
|
|
1148
|
-
'id': 'arg',
|
|
1149
|
-
},
|
|
1150
|
-
],
|
|
1151
|
-
},
|
|
1152
|
-
},
|
|
1153
|
-
this.workspace,
|
|
1154
|
-
);
|
|
1155
|
-
const callBlock = Blockly.serialization.blocks.append(
|
|
1156
|
-
{
|
|
1157
|
-
'type': 'procedures_callreturn',
|
|
1158
|
-
'extraState': {
|
|
1159
|
-
'name': 'do something',
|
|
1160
|
-
'params': ['y'],
|
|
1161
|
-
},
|
|
1162
|
-
},
|
|
1163
|
-
this.workspace,
|
|
1164
|
-
{recordUndo: true},
|
|
1165
|
-
);
|
|
1166
|
-
this.clock.runAll();
|
|
1167
|
-
assertDefBlockStructure(defBlock, true, ['x'], ['arg']);
|
|
1168
|
-
assertCallBlockStructure(
|
|
1169
|
-
callBlock,
|
|
1170
|
-
['y'],
|
|
1171
|
-
[this.TEST_VAR_ID],
|
|
1172
|
-
'do something2',
|
|
1173
|
-
);
|
|
1174
|
-
});
|
|
1175
|
-
|
|
1176
|
-
test.skip('callers whose defs are deserialized later do not create defs', function () {
|
|
1177
|
-
Blockly.serialization.workspaces.load(
|
|
1178
|
-
{
|
|
1179
|
-
'blocks': {
|
|
1180
|
-
'languageVersion': 0,
|
|
1181
|
-
'blocks': [
|
|
1182
|
-
{
|
|
1183
|
-
'type': 'procedures_callreturn',
|
|
1184
|
-
'extraState': {
|
|
1185
|
-
'params': ['x'],
|
|
1186
|
-
},
|
|
1187
|
-
},
|
|
1188
|
-
{
|
|
1189
|
-
'type': 'procedures_defreturn',
|
|
1190
|
-
'fields': {
|
|
1191
|
-
'NAME': 'do something',
|
|
1192
|
-
},
|
|
1193
|
-
'extraState': {
|
|
1194
|
-
'params': [
|
|
1195
|
-
{
|
|
1196
|
-
'name': 'x',
|
|
1197
|
-
'id': 'arg',
|
|
1198
|
-
},
|
|
1199
|
-
],
|
|
1200
|
-
},
|
|
1201
|
-
},
|
|
1202
|
-
],
|
|
1203
|
-
},
|
|
1204
|
-
},
|
|
1205
|
-
this.workspace,
|
|
1206
|
-
);
|
|
1207
|
-
this.clock.runAll();
|
|
1208
|
-
const defBlock = this.workspace.getBlocksByType(
|
|
1209
|
-
'procedures_defreturn',
|
|
1210
|
-
)[0];
|
|
1211
|
-
const callBlock = this.workspace.getBlocksByType(
|
|
1212
|
-
'procedures_callreturn',
|
|
1213
|
-
)[0];
|
|
1214
|
-
// TODO: Currently the callers are creating variables with different
|
|
1215
|
-
// IDs than those serialized to JSON, so these assertions fail.
|
|
1216
|
-
assertDefBlockStructure(defBlock, true, ['x'], ['arg']);
|
|
1217
|
-
assertCallBlockStructure(callBlock, ['x'], ['arg'], 'do something');
|
|
1218
|
-
});
|
|
1219
|
-
});
|
|
1220
|
-
});
|
|
1221
|
-
|
|
1222
|
-
suite('definition block context menu', function () {
|
|
1223
|
-
test('the context menu includes an option for creating the caller', function () {
|
|
1224
|
-
const def = Blockly.serialization.blocks.append(
|
|
1225
|
-
{
|
|
1226
|
-
'type': 'procedures_defnoreturn',
|
|
1227
|
-
'fields': {
|
|
1228
|
-
'NAME': 'test name',
|
|
1229
|
-
},
|
|
1230
|
-
},
|
|
1231
|
-
this.workspace,
|
|
1232
|
-
);
|
|
1233
|
-
|
|
1234
|
-
const options = [];
|
|
1235
|
-
def.customContextMenu(options);
|
|
1236
|
-
|
|
1237
|
-
assert.isTrue(
|
|
1238
|
-
options[0].text.includes('test name'),
|
|
1239
|
-
'Expected the context menu to have an option to create the caller',
|
|
1240
|
-
);
|
|
1241
|
-
});
|
|
1242
|
-
|
|
1243
|
-
test('the context menu includes an option for each parameter', function () {
|
|
1244
|
-
const def = Blockly.serialization.blocks.append(
|
|
1245
|
-
{
|
|
1246
|
-
'type': 'procedures_defnoreturn',
|
|
1247
|
-
'fields': {
|
|
1248
|
-
'NAME': 'test name',
|
|
1249
|
-
},
|
|
1250
|
-
'extraState': {
|
|
1251
|
-
'params': [
|
|
1252
|
-
{
|
|
1253
|
-
'name': 'testParam1',
|
|
1254
|
-
'id': 'varId1',
|
|
1255
|
-
'paramId': 'paramId1',
|
|
1256
|
-
},
|
|
1257
|
-
{
|
|
1258
|
-
'name': 'testParam2',
|
|
1259
|
-
'id': 'varId2',
|
|
1260
|
-
'paramId': 'paramId2',
|
|
1261
|
-
},
|
|
1262
|
-
],
|
|
1263
|
-
},
|
|
1264
|
-
},
|
|
1265
|
-
this.workspace,
|
|
1266
|
-
);
|
|
1267
|
-
|
|
1268
|
-
const options = [];
|
|
1269
|
-
def.customContextMenu(options);
|
|
1270
|
-
|
|
1271
|
-
assert.isTrue(
|
|
1272
|
-
options[1].text.includes('testParam1'),
|
|
1273
|
-
'Expected the context menu to have an option to create the first param',
|
|
1274
|
-
);
|
|
1275
|
-
assert.isTrue(
|
|
1276
|
-
options[2].text.includes('testParam2'),
|
|
1277
|
-
'Expected the context menu to have an option to create the second param',
|
|
1278
|
-
);
|
|
1279
|
-
});
|
|
1280
|
-
});
|
|
1281
|
-
|
|
1282
|
-
suite('allProcedures', function () {
|
|
1283
|
-
test('Only Procedures', function () {
|
|
1284
|
-
const noReturnBlock = this.workspace.newBlock('procedures_defnoreturn');
|
|
1285
|
-
noReturnBlock.setFieldValue('no return', 'NAME');
|
|
1286
|
-
const returnBlock = this.workspace.newBlock('procedures_defreturn');
|
|
1287
|
-
returnBlock.setFieldValue('return', 'NAME');
|
|
1288
|
-
|
|
1289
|
-
const allProcedures = Blockly.Procedures.allProcedures(this.workspace);
|
|
1290
|
-
assert.lengthOf(allProcedures, 2);
|
|
1291
|
-
|
|
1292
|
-
assert.lengthOf(allProcedures[0], 1);
|
|
1293
|
-
assert.equal(allProcedures[0][0][0], 'no return');
|
|
1294
|
-
|
|
1295
|
-
assert.lengthOf(allProcedures[1], 1);
|
|
1296
|
-
assert.equal(allProcedures[1][0][0], 'return');
|
|
1297
|
-
});
|
|
1298
|
-
|
|
1299
|
-
test('Multiple Blocks', function () {
|
|
1300
|
-
const noReturnBlock = this.workspace.newBlock('procedures_defnoreturn');
|
|
1301
|
-
noReturnBlock.setFieldValue('no return', 'NAME');
|
|
1302
|
-
const returnBlock = this.workspace.newBlock('procedures_defreturn');
|
|
1303
|
-
returnBlock.setFieldValue('return', 'NAME');
|
|
1304
|
-
const returnBlock2 = this.workspace.newBlock('procedures_defreturn');
|
|
1305
|
-
returnBlock2.setFieldValue('return2', 'NAME');
|
|
1306
|
-
const _ = this.workspace.newBlock('controls_if');
|
|
1307
|
-
|
|
1308
|
-
const allProcedures = Blockly.Procedures.allProcedures(this.workspace);
|
|
1309
|
-
assert.lengthOf(allProcedures, 2);
|
|
1310
|
-
|
|
1311
|
-
assert.lengthOf(allProcedures[0], 1);
|
|
1312
|
-
assert.equal(allProcedures[0][0][0], 'no return');
|
|
1313
|
-
|
|
1314
|
-
assert.lengthOf(allProcedures[1], 2);
|
|
1315
|
-
assert.equal(allProcedures[1][0][0], 'return');
|
|
1316
|
-
assert.equal(allProcedures[1][1][0], 'return2');
|
|
1317
|
-
});
|
|
1318
|
-
|
|
1319
|
-
test('No Procedures', function () {
|
|
1320
|
-
const _ = this.workspace.newBlock('controls_if');
|
|
1321
|
-
const allProcedures = Blockly.Procedures.allProcedures(this.workspace);
|
|
1322
|
-
assert.lengthOf(allProcedures, 2);
|
|
1323
|
-
assert.lengthOf(
|
|
1324
|
-
allProcedures[0],
|
|
1325
|
-
0,
|
|
1326
|
-
'No procedures_defnoreturn blocks expected',
|
|
1327
|
-
);
|
|
1328
|
-
assert.lengthOf(
|
|
1329
|
-
allProcedures[1],
|
|
1330
|
-
0,
|
|
1331
|
-
'No procedures_defreturn blocks expected',
|
|
1332
|
-
);
|
|
1333
|
-
});
|
|
1334
|
-
});
|
|
1335
|
-
|
|
1336
|
-
suite('isNameUsed', function () {
|
|
1337
|
-
test('returns false if no blocks or models exists', function () {
|
|
1338
|
-
assert.isFalse(
|
|
1339
|
-
Blockly.Procedures.isNameUsed('proc name', this.workspace),
|
|
1340
|
-
);
|
|
1341
|
-
});
|
|
1342
|
-
|
|
1343
|
-
test('returns true if an associated block exists', function () {
|
|
1344
|
-
createProcDefBlock(this.workspace, false, [], 'proc name');
|
|
1345
|
-
assert.isTrue(Blockly.Procedures.isNameUsed('proc name', this.workspace));
|
|
1346
|
-
});
|
|
1347
|
-
|
|
1348
|
-
test('return false if an associated block does not exist', function () {
|
|
1349
|
-
createProcDefBlock(this.workspace, false, [], 'proc name');
|
|
1350
|
-
assert.isFalse(
|
|
1351
|
-
Blockly.Procedures.isNameUsed('other proc name', this.workspace),
|
|
1352
|
-
);
|
|
1353
|
-
});
|
|
1354
|
-
|
|
1355
|
-
test('returns true if an associated procedure model exists', function () {
|
|
1356
|
-
this.workspace
|
|
1357
|
-
.getProcedureMap()
|
|
1358
|
-
.add(new MockProcedureModel().setName('proc name'));
|
|
1359
|
-
assert.isTrue(Blockly.Procedures.isNameUsed('proc name', this.workspace));
|
|
1360
|
-
});
|
|
1361
|
-
|
|
1362
|
-
test('returns false if an associated procedure model exists', function () {
|
|
1363
|
-
this.workspace
|
|
1364
|
-
.getProcedureMap()
|
|
1365
|
-
.add(new MockProcedureModel().setName('proc name'));
|
|
1366
|
-
assert.isFalse(
|
|
1367
|
-
Blockly.Procedures.isNameUsed('other proc name', this.workspace),
|
|
1368
|
-
);
|
|
1369
|
-
});
|
|
1370
|
-
});
|
|
1371
|
-
|
|
1372
|
-
suite('Multiple block serialization', function () {
|
|
1373
|
-
function assertDefAndCallBlocks(
|
|
1374
|
-
workspace,
|
|
1375
|
-
noReturnNames,
|
|
1376
|
-
returnNames,
|
|
1377
|
-
hasCallers,
|
|
1378
|
-
) {
|
|
1379
|
-
const allProcedures = Blockly.Procedures.allProcedures(workspace);
|
|
1380
|
-
const defNoReturnBlocks = allProcedures[0];
|
|
1381
|
-
assert.lengthOf(
|
|
1382
|
-
defNoReturnBlocks,
|
|
1383
|
-
noReturnNames.length,
|
|
1384
|
-
`Expected the number of no return blocks to be ${noReturnNames.length}`,
|
|
1385
|
-
);
|
|
1386
|
-
for (let i = 0; i < noReturnNames.length; i++) {
|
|
1387
|
-
const expectedName = noReturnNames[i];
|
|
1388
|
-
assert.equal(defNoReturnBlocks[i][0], expectedName);
|
|
1389
|
-
if (hasCallers) {
|
|
1390
|
-
const callers = Blockly.Procedures.getCallers(
|
|
1391
|
-
expectedName,
|
|
1392
|
-
workspace,
|
|
1393
|
-
);
|
|
1394
|
-
assert.lengthOf(
|
|
1395
|
-
callers,
|
|
1396
|
-
1,
|
|
1397
|
-
`Expected there to be one caller of the ${expectedName} block`,
|
|
1398
|
-
);
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
const defReturnBlocks = allProcedures[1];
|
|
1402
|
-
assert.lengthOf(
|
|
1403
|
-
defReturnBlocks,
|
|
1404
|
-
returnNames.length,
|
|
1405
|
-
`Expected the number of return blocks to be ${returnNames.length}`,
|
|
1406
|
-
);
|
|
1407
|
-
for (let i = 0; i < returnNames.length; i++) {
|
|
1408
|
-
const expectedName = returnNames[i];
|
|
1409
|
-
assert.equal(defReturnBlocks[i][0], expectedName);
|
|
1410
|
-
if (hasCallers) {
|
|
1411
|
-
const callers = Blockly.Procedures.getCallers(
|
|
1412
|
-
expectedName,
|
|
1413
|
-
workspace,
|
|
1414
|
-
);
|
|
1415
|
-
assert.lengthOf(
|
|
1416
|
-
callers,
|
|
1417
|
-
1,
|
|
1418
|
-
`Expected there to be one caller of the ${expectedName} block`,
|
|
1419
|
-
);
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
// Expecting def and caller blocks are the only blocks on workspace
|
|
1424
|
-
let expectedCount = noReturnNames.length + returnNames.length;
|
|
1425
|
-
if (hasCallers) {
|
|
1426
|
-
expectedCount *= 2;
|
|
1427
|
-
}
|
|
1428
|
-
const blocks = workspace.getAllBlocks(false);
|
|
1429
|
-
assert.lengthOf(blocks, expectedCount);
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
suite('no name renamed to unnamed', function () {
|
|
1433
|
-
test('defnoreturn and defreturn', function () {
|
|
1434
|
-
const xml = Blockly.utils.xml.textToDom(`
|
|
1435
|
-
<xml xmlns="https://developers.google.com/blockly/xml">
|
|
1436
|
-
<block type="procedures_defnoreturn"/>
|
|
1437
|
-
<block type="procedures_defreturn"/>
|
|
1438
|
-
</xml>`);
|
|
1439
|
-
Blockly.Xml.domToWorkspace(xml, this.workspace);
|
|
1440
|
-
this.clock.runAll();
|
|
1441
|
-
|
|
1442
|
-
assertDefAndCallBlocks(
|
|
1443
|
-
this.workspace,
|
|
1444
|
-
['unnamed'],
|
|
1445
|
-
['unnamed2'],
|
|
1446
|
-
false,
|
|
1447
|
-
);
|
|
1448
|
-
});
|
|
1449
|
-
|
|
1450
|
-
test('defreturn and defnoreturn', function () {
|
|
1451
|
-
const xml = Blockly.utils.xml.textToDom(`
|
|
1452
|
-
<xml xmlns="https://developers.google.com/blockly/xml">
|
|
1453
|
-
<block type="procedures_defreturn"/>
|
|
1454
|
-
<block type="procedures_defnoreturn"/>
|
|
1455
|
-
</xml>`);
|
|
1456
|
-
Blockly.Xml.domToWorkspace(xml, this.workspace);
|
|
1457
|
-
this.clock.runAll();
|
|
1458
|
-
|
|
1459
|
-
assertDefAndCallBlocks(
|
|
1460
|
-
this.workspace,
|
|
1461
|
-
['unnamed2'],
|
|
1462
|
-
['unnamed'],
|
|
1463
|
-
false,
|
|
1464
|
-
);
|
|
1465
|
-
});
|
|
1466
|
-
|
|
1467
|
-
test('callreturn (no def in xml)', function () {
|
|
1468
|
-
const xml = Blockly.utils.xml.textToDom(`
|
|
1469
|
-
<xml xmlns="https://developers.google.com/blockly/xml">
|
|
1470
|
-
<block type="procedures_callreturn"/>
|
|
1471
|
-
</xml>`);
|
|
1472
|
-
Blockly.Xml.domToWorkspace(xml, this.workspace);
|
|
1473
|
-
this.clock.runAll();
|
|
1474
|
-
assertDefAndCallBlocks(this.workspace, [], ['unnamed'], true);
|
|
1475
|
-
});
|
|
1476
|
-
|
|
1477
|
-
test('callnoreturn and callreturn (no def in xml)', function () {
|
|
1478
|
-
const xml = Blockly.utils.xml.textToDom(`
|
|
1479
|
-
<xml xmlns="https://developers.google.com/blockly/xml">
|
|
1480
|
-
<block type="procedures_callnoreturn" id="first"/>
|
|
1481
|
-
<block type="procedures_callreturn" id="second"/>
|
|
1482
|
-
</xml>`);
|
|
1483
|
-
Blockly.Xml.domToWorkspace(xml, this.workspace);
|
|
1484
|
-
this.clock.runAll();
|
|
1485
|
-
assertDefAndCallBlocks(this.workspace, ['unnamed'], ['unnamed2'], true);
|
|
1486
|
-
});
|
|
1487
|
-
|
|
1488
|
-
test('callreturn and callnoreturn (no def in xml)', function () {
|
|
1489
|
-
const xml = Blockly.utils.xml.textToDom(`
|
|
1490
|
-
<xml xmlns="https://developers.google.com/blockly/xml">
|
|
1491
|
-
<block type="procedures_callreturn"/>
|
|
1492
|
-
<block type="procedures_callnoreturn"/>
|
|
1493
|
-
</xml>`);
|
|
1494
|
-
Blockly.Xml.domToWorkspace(xml, this.workspace);
|
|
1495
|
-
this.clock.runAll();
|
|
1496
|
-
assertDefAndCallBlocks(this.workspace, ['unnamed2'], ['unnamed'], true);
|
|
1497
|
-
});
|
|
1498
|
-
});
|
|
1499
|
-
});
|
|
1500
|
-
|
|
1501
|
-
suite('getDefinition - Modified cases', function () {
|
|
1502
|
-
setup(function () {
|
|
1503
|
-
Blockly.Blocks['new_proc'] = {
|
|
1504
|
-
init: function () {},
|
|
1505
|
-
getProcedureDef: function () {
|
|
1506
|
-
return [this.name, [], false];
|
|
1507
|
-
},
|
|
1508
|
-
name: 'test',
|
|
1509
|
-
};
|
|
1510
|
-
|
|
1511
|
-
Blockly.Blocks['nested_proc'] = {
|
|
1512
|
-
init: function () {
|
|
1513
|
-
this.setPreviousStatement(true, null);
|
|
1514
|
-
this.setNextStatement(true, null);
|
|
1515
|
-
},
|
|
1516
|
-
getProcedureDef: function () {
|
|
1517
|
-
return [this.name, [], false];
|
|
1518
|
-
},
|
|
1519
|
-
name: 'test',
|
|
1520
|
-
};
|
|
1521
|
-
});
|
|
1522
|
-
|
|
1523
|
-
teardown(function () {
|
|
1524
|
-
delete Blockly.Blocks['new_proc'];
|
|
1525
|
-
delete Blockly.Blocks['nested_proc'];
|
|
1526
|
-
});
|
|
1527
|
-
|
|
1528
|
-
test('Custom procedure block', function () {
|
|
1529
|
-
// Do not require procedures to be the built-in procedures.
|
|
1530
|
-
const defBlock = this.workspace.newBlock('new_proc');
|
|
1531
|
-
const def = Blockly.Procedures.getDefinition('test', this.workspace);
|
|
1532
|
-
assert.equal(def, defBlock);
|
|
1533
|
-
});
|
|
1534
|
-
|
|
1535
|
-
test('Stacked procedures', function () {
|
|
1536
|
-
const blockA = this.workspace.newBlock('nested_proc');
|
|
1537
|
-
const blockB = this.workspace.newBlock('nested_proc');
|
|
1538
|
-
blockA.name = 'a';
|
|
1539
|
-
blockB.name = 'b';
|
|
1540
|
-
blockA.nextConnection.connect(blockB.previousConnection);
|
|
1541
|
-
const def = Blockly.Procedures.getDefinition('b', this.workspace);
|
|
1542
|
-
assert.equal(def, blockB);
|
|
1543
|
-
});
|
|
1544
|
-
});
|
|
1545
|
-
|
|
1546
|
-
const testSuites = [
|
|
1547
|
-
{
|
|
1548
|
-
title: 'procedures_defreturn',
|
|
1549
|
-
hasReturn: true,
|
|
1550
|
-
defType: 'procedures_defreturn',
|
|
1551
|
-
callType: 'procedures_callreturn',
|
|
1552
|
-
},
|
|
1553
|
-
{
|
|
1554
|
-
title: 'procedures_defnoreturn',
|
|
1555
|
-
hasReturn: false,
|
|
1556
|
-
defType: 'procedures_defnoreturn',
|
|
1557
|
-
callType: 'procedures_callnoreturn',
|
|
1558
|
-
},
|
|
1559
|
-
];
|
|
1560
|
-
|
|
1561
|
-
testSuites.forEach((testSuite) => {
|
|
1562
|
-
suite(testSuite.title, function () {
|
|
1563
|
-
suite('Structure', function () {
|
|
1564
|
-
setup(function () {
|
|
1565
|
-
this.defBlock = this.workspace.newBlock(testSuite.defType);
|
|
1566
|
-
this.defBlock.setFieldValue('proc name', 'NAME');
|
|
1567
|
-
});
|
|
1568
|
-
test('Definition block', function () {
|
|
1569
|
-
assertDefBlockStructure(this.defBlock, testSuite.hasReturn);
|
|
1570
|
-
});
|
|
1571
|
-
|
|
1572
|
-
test('Call block', function () {
|
|
1573
|
-
this.callBlock = Blockly.serialization.blocks.append(
|
|
1574
|
-
{
|
|
1575
|
-
'type': testSuite.callType,
|
|
1576
|
-
},
|
|
1577
|
-
this.workspace,
|
|
1578
|
-
{recordUndo: true},
|
|
1579
|
-
);
|
|
1580
|
-
this.callBlock.setFieldValue('proc name', 'NAME');
|
|
1581
|
-
this.clock.runAll();
|
|
1582
|
-
assertCallBlockStructure(this.callBlock);
|
|
1583
|
-
});
|
|
1584
|
-
});
|
|
1585
|
-
suite('rename', function () {
|
|
1586
|
-
setup(function () {
|
|
1587
|
-
this.defBlock = Blockly.serialization.blocks.append(
|
|
1588
|
-
{
|
|
1589
|
-
'type': testSuite.defType,
|
|
1590
|
-
'fields': {
|
|
1591
|
-
'NAME': 'proc name',
|
|
1592
|
-
},
|
|
1593
|
-
},
|
|
1594
|
-
this.workspace,
|
|
1595
|
-
);
|
|
1596
|
-
this.callBlock = Blockly.serialization.blocks.append(
|
|
1597
|
-
{
|
|
1598
|
-
'type': testSuite.callType,
|
|
1599
|
-
'fields': {
|
|
1600
|
-
'NAME': 'proc name',
|
|
1601
|
-
},
|
|
1602
|
-
},
|
|
1603
|
-
this.workspace,
|
|
1604
|
-
);
|
|
1605
|
-
sinon.stub(this.defBlock.getField('NAME'), 'resizeEditor_');
|
|
1606
|
-
});
|
|
1607
|
-
test('Simple, Programmatic', function () {
|
|
1608
|
-
this.defBlock.setFieldValue(
|
|
1609
|
-
this.defBlock.getFieldValue('NAME') + '2',
|
|
1610
|
-
'NAME',
|
|
1611
|
-
);
|
|
1612
|
-
assert.equal(this.defBlock.getFieldValue('NAME'), 'proc name2');
|
|
1613
|
-
assert.equal(this.callBlock.getFieldValue('NAME'), 'proc name2');
|
|
1614
|
-
});
|
|
1615
|
-
test('Simple, Input', function () {
|
|
1616
|
-
const defInput = this.defBlock.getField('NAME');
|
|
1617
|
-
defInput.htmlInput_ = document.createElement('input');
|
|
1618
|
-
defInput.htmlInput_.setAttribute(
|
|
1619
|
-
'data-untyped-default-value',
|
|
1620
|
-
'proc name',
|
|
1621
|
-
);
|
|
1622
|
-
|
|
1623
|
-
defInput.htmlInput_.value = 'proc name2';
|
|
1624
|
-
defInput.onHtmlInputChange_(null);
|
|
1625
|
-
assert.equal(this.defBlock.getFieldValue('NAME'), 'proc name2');
|
|
1626
|
-
assert.equal(this.callBlock.getFieldValue('NAME'), 'proc name2');
|
|
1627
|
-
});
|
|
1628
|
-
test('lower -> CAPS', function () {
|
|
1629
|
-
const defInput = this.defBlock.getField('NAME');
|
|
1630
|
-
defInput.htmlInput_ = document.createElement('input');
|
|
1631
|
-
defInput.htmlInput_.setAttribute(
|
|
1632
|
-
'data-untyped-default-value',
|
|
1633
|
-
'proc name',
|
|
1634
|
-
);
|
|
1635
|
-
|
|
1636
|
-
defInput.htmlInput_.value = 'PROC NAME';
|
|
1637
|
-
defInput.onHtmlInputChange_(null);
|
|
1638
|
-
assert.equal(this.defBlock.getFieldValue('NAME'), 'PROC NAME');
|
|
1639
|
-
assert.equal(this.callBlock.getFieldValue('NAME'), 'PROC NAME');
|
|
1640
|
-
});
|
|
1641
|
-
test('CAPS -> lower', function () {
|
|
1642
|
-
this.defBlock.setFieldValue('PROC NAME', 'NAME');
|
|
1643
|
-
this.callBlock.setFieldValue('PROC NAME', 'NAME');
|
|
1644
|
-
const defInput = this.defBlock.getField('NAME');
|
|
1645
|
-
defInput.htmlInput_ = document.createElement('input');
|
|
1646
|
-
defInput.htmlInput_.setAttribute(
|
|
1647
|
-
'data-untyped-default-value',
|
|
1648
|
-
'PROC NAME',
|
|
1649
|
-
);
|
|
1650
|
-
|
|
1651
|
-
defInput.htmlInput_.value = 'proc name';
|
|
1652
|
-
defInput.onHtmlInputChange_(null);
|
|
1653
|
-
assert.equal(this.defBlock.getFieldValue('NAME'), 'proc name');
|
|
1654
|
-
assert.equal(this.callBlock.getFieldValue('NAME'), 'proc name');
|
|
1655
|
-
});
|
|
1656
|
-
test('Whitespace', function () {
|
|
1657
|
-
const defInput = this.defBlock.getField('NAME');
|
|
1658
|
-
defInput.htmlInput_ = document.createElement('input');
|
|
1659
|
-
defInput.htmlInput_.setAttribute(
|
|
1660
|
-
'data-untyped-default-value',
|
|
1661
|
-
'proc name',
|
|
1662
|
-
);
|
|
1663
|
-
|
|
1664
|
-
defInput.htmlInput_.value = 'proc name ';
|
|
1665
|
-
defInput.onHtmlInputChange_(null);
|
|
1666
|
-
assert.equal(this.defBlock.getFieldValue('NAME'), 'proc name');
|
|
1667
|
-
assert.equal(this.callBlock.getFieldValue('NAME'), 'proc name');
|
|
1668
|
-
});
|
|
1669
|
-
test('Whitespace then Text', function () {
|
|
1670
|
-
const defInput = this.defBlock.getField('NAME');
|
|
1671
|
-
defInput.htmlInput_ = document.createElement('input');
|
|
1672
|
-
defInput.htmlInput_.setAttribute(
|
|
1673
|
-
'data-untyped-default-value',
|
|
1674
|
-
'proc name',
|
|
1675
|
-
);
|
|
1676
|
-
|
|
1677
|
-
defInput.htmlInput_.value = 'proc name ';
|
|
1678
|
-
defInput.onHtmlInputChange_(null);
|
|
1679
|
-
defInput.htmlInput_.value = 'proc name 2';
|
|
1680
|
-
defInput.onHtmlInputChange_(null);
|
|
1681
|
-
assert.equal(this.defBlock.getFieldValue('NAME'), 'proc name 2');
|
|
1682
|
-
assert.equal(this.callBlock.getFieldValue('NAME'), 'proc name 2');
|
|
1683
|
-
});
|
|
1684
|
-
test('Set Empty', function () {
|
|
1685
|
-
const defInput = this.defBlock.getField('NAME');
|
|
1686
|
-
defInput.htmlInput_ = document.createElement('input');
|
|
1687
|
-
defInput.htmlInput_.setAttribute(
|
|
1688
|
-
'data-untyped-default-value',
|
|
1689
|
-
'proc name',
|
|
1690
|
-
);
|
|
1691
|
-
|
|
1692
|
-
defInput.htmlInput_.value = '';
|
|
1693
|
-
defInput.onHtmlInputChange_(null);
|
|
1694
|
-
assert.equal(
|
|
1695
|
-
this.defBlock.getFieldValue('NAME'),
|
|
1696
|
-
Blockly.Msg['UNNAMED_KEY'],
|
|
1697
|
-
);
|
|
1698
|
-
assert.equal(
|
|
1699
|
-
this.callBlock.getFieldValue('NAME'),
|
|
1700
|
-
Blockly.Msg['UNNAMED_KEY'],
|
|
1701
|
-
);
|
|
1702
|
-
});
|
|
1703
|
-
test('Set Empty, and Create New', function () {
|
|
1704
|
-
const defInput = this.defBlock.getField('NAME');
|
|
1705
|
-
defInput.htmlInput_ = document.createElement('input');
|
|
1706
|
-
defInput.htmlInput_.setAttribute(
|
|
1707
|
-
'data-untyped-default-value',
|
|
1708
|
-
'proc name',
|
|
1709
|
-
);
|
|
1710
|
-
|
|
1711
|
-
defInput.htmlInput_.value = '';
|
|
1712
|
-
defInput.onHtmlInputChange_(null);
|
|
1713
|
-
const newDefBlock = this.workspace.newBlock(testSuite.defType);
|
|
1714
|
-
newDefBlock.setFieldValue('new name', 'NAME');
|
|
1715
|
-
assert.equal(
|
|
1716
|
-
this.defBlock.getFieldValue('NAME'),
|
|
1717
|
-
Blockly.Msg['UNNAMED_KEY'],
|
|
1718
|
-
);
|
|
1719
|
-
assert.equal(
|
|
1720
|
-
this.callBlock.getFieldValue('NAME'),
|
|
1721
|
-
Blockly.Msg['UNNAMED_KEY'],
|
|
1722
|
-
);
|
|
1723
|
-
});
|
|
1724
|
-
});
|
|
1725
|
-
suite('getCallers', function () {
|
|
1726
|
-
setup(function () {
|
|
1727
|
-
this.defBlock = Blockly.serialization.blocks.append(
|
|
1728
|
-
{
|
|
1729
|
-
'type': testSuite.defType,
|
|
1730
|
-
'fields': {
|
|
1731
|
-
'NAME': 'proc name',
|
|
1732
|
-
},
|
|
1733
|
-
},
|
|
1734
|
-
this.workspace,
|
|
1735
|
-
);
|
|
1736
|
-
this.callBlock = Blockly.serialization.blocks.append(
|
|
1737
|
-
{
|
|
1738
|
-
'type': testSuite.callType,
|
|
1739
|
-
'fields': {
|
|
1740
|
-
'NAME': 'proc name',
|
|
1741
|
-
},
|
|
1742
|
-
},
|
|
1743
|
-
this.workspace,
|
|
1744
|
-
);
|
|
1745
|
-
});
|
|
1746
|
-
test('Simple', function () {
|
|
1747
|
-
const callers = Blockly.Procedures.getCallers(
|
|
1748
|
-
'proc name',
|
|
1749
|
-
this.workspace,
|
|
1750
|
-
);
|
|
1751
|
-
assert.equal(callers.length, 1);
|
|
1752
|
-
assert.equal(callers[0], this.callBlock);
|
|
1753
|
-
});
|
|
1754
|
-
test('Multiple Callers', function () {
|
|
1755
|
-
const caller2 = this.workspace.newBlock(testSuite.callType);
|
|
1756
|
-
caller2.setFieldValue('proc name', 'NAME');
|
|
1757
|
-
const caller3 = this.workspace.newBlock(testSuite.callType);
|
|
1758
|
-
caller3.setFieldValue('proc name', 'NAME');
|
|
1759
|
-
|
|
1760
|
-
const callers = Blockly.Procedures.getCallers(
|
|
1761
|
-
'proc name',
|
|
1762
|
-
this.workspace,
|
|
1763
|
-
);
|
|
1764
|
-
assert.equal(callers.length, 3);
|
|
1765
|
-
assert.equal(callers[0], this.callBlock);
|
|
1766
|
-
assert.equal(callers[1], caller2);
|
|
1767
|
-
assert.equal(callers[2], caller3);
|
|
1768
|
-
});
|
|
1769
|
-
test('Multiple Procedures', function () {
|
|
1770
|
-
const def2 = this.workspace.newBlock(testSuite.defType);
|
|
1771
|
-
def2.setFieldValue('proc name2', 'NAME');
|
|
1772
|
-
const caller2 = this.workspace.newBlock(testSuite.callType);
|
|
1773
|
-
caller2.setFieldValue('proc name2', 'NAME');
|
|
1774
|
-
|
|
1775
|
-
const callers = Blockly.Procedures.getCallers(
|
|
1776
|
-
'proc name',
|
|
1777
|
-
this.workspace,
|
|
1778
|
-
);
|
|
1779
|
-
assert.equal(callers.length, 1);
|
|
1780
|
-
assert.equal(callers[0], this.callBlock);
|
|
1781
|
-
});
|
|
1782
|
-
// This can occur if you:
|
|
1783
|
-
// 1) Create an uppercase definition and call block.
|
|
1784
|
-
// 2) Delete both blocks.
|
|
1785
|
-
// 3) Create a lowercase definition and call block.
|
|
1786
|
-
// 4) Retrieve the uppercase call block from the trashcan.
|
|
1787
|
-
// (And vise versa for creating lowercase blocks first)
|
|
1788
|
-
// When converted to code all function names will be lowercase, so a
|
|
1789
|
-
// caller should still be returned for a differently-cased procedure.
|
|
1790
|
-
test('Call Different Case', function () {
|
|
1791
|
-
this.callBlock.setFieldValue('PROC NAME', 'NAME');
|
|
1792
|
-
const callers = Blockly.Procedures.getCallers(
|
|
1793
|
-
'proc name',
|
|
1794
|
-
this.workspace,
|
|
1795
|
-
);
|
|
1796
|
-
assert.equal(callers.length, 1);
|
|
1797
|
-
assert.equal(callers[0], this.callBlock);
|
|
1798
|
-
});
|
|
1799
|
-
test('Multiple Workspaces', function () {
|
|
1800
|
-
const workspace = new Blockly.Workspace();
|
|
1801
|
-
try {
|
|
1802
|
-
const def2 = workspace.newBlock(testSuite.defType);
|
|
1803
|
-
def2.setFieldValue('proc name', 'NAME');
|
|
1804
|
-
const caller2 = workspace.newBlock(testSuite.callType);
|
|
1805
|
-
caller2.setFieldValue('proc name', 'NAME');
|
|
1806
|
-
|
|
1807
|
-
let callers = Blockly.Procedures.getCallers(
|
|
1808
|
-
'proc name',
|
|
1809
|
-
this.workspace,
|
|
1810
|
-
);
|
|
1811
|
-
assert.equal(callers.length, 1);
|
|
1812
|
-
assert.equal(callers[0], this.callBlock);
|
|
1813
|
-
|
|
1814
|
-
callers = Blockly.Procedures.getCallers('proc name', workspace);
|
|
1815
|
-
assert.equal(callers.length, 1);
|
|
1816
|
-
assert.equal(callers[0], caller2);
|
|
1817
|
-
} finally {
|
|
1818
|
-
workspaceTeardown.call(this, workspace);
|
|
1819
|
-
}
|
|
1820
|
-
});
|
|
1821
|
-
});
|
|
1822
|
-
suite('getDefinition', function () {
|
|
1823
|
-
setup(function () {
|
|
1824
|
-
this.defBlock = Blockly.serialization.blocks.append(
|
|
1825
|
-
{
|
|
1826
|
-
'type': testSuite.defType,
|
|
1827
|
-
'fields': {
|
|
1828
|
-
'NAME': 'proc name',
|
|
1829
|
-
},
|
|
1830
|
-
},
|
|
1831
|
-
this.workspace,
|
|
1832
|
-
);
|
|
1833
|
-
this.callBlock = Blockly.serialization.blocks.append(
|
|
1834
|
-
{
|
|
1835
|
-
'type': testSuite.callType,
|
|
1836
|
-
'fields': {
|
|
1837
|
-
'NAME': 'proc name',
|
|
1838
|
-
},
|
|
1839
|
-
},
|
|
1840
|
-
this.workspace,
|
|
1841
|
-
);
|
|
1842
|
-
});
|
|
1843
|
-
test('Simple', function () {
|
|
1844
|
-
const def = Blockly.Procedures.getDefinition(
|
|
1845
|
-
'proc name',
|
|
1846
|
-
this.workspace,
|
|
1847
|
-
);
|
|
1848
|
-
assert.equal(def, this.defBlock);
|
|
1849
|
-
});
|
|
1850
|
-
test('Multiple Procedures', function () {
|
|
1851
|
-
const def2 = this.workspace.newBlock(testSuite.defType);
|
|
1852
|
-
def2.setFieldValue('proc name2', 'NAME');
|
|
1853
|
-
const caller2 = this.workspace.newBlock(testSuite.callType);
|
|
1854
|
-
caller2.setFieldValue('proc name2', 'NAME');
|
|
1855
|
-
|
|
1856
|
-
const def = Blockly.Procedures.getDefinition(
|
|
1857
|
-
'proc name',
|
|
1858
|
-
this.workspace,
|
|
1859
|
-
);
|
|
1860
|
-
assert.equal(def, this.defBlock);
|
|
1861
|
-
});
|
|
1862
|
-
test('Multiple Workspaces', function () {
|
|
1863
|
-
const workspace = new Blockly.Workspace();
|
|
1864
|
-
try {
|
|
1865
|
-
const def2 = workspace.newBlock(testSuite.defType);
|
|
1866
|
-
def2.setFieldValue('proc name', 'NAME');
|
|
1867
|
-
const caller2 = workspace.newBlock(testSuite.callType);
|
|
1868
|
-
caller2.setFieldValue('proc name', 'NAME');
|
|
1869
|
-
|
|
1870
|
-
let def = Blockly.Procedures.getDefinition(
|
|
1871
|
-
'proc name',
|
|
1872
|
-
this.workspace,
|
|
1873
|
-
);
|
|
1874
|
-
assert.equal(def, this.defBlock);
|
|
1875
|
-
|
|
1876
|
-
def = Blockly.Procedures.getDefinition('proc name', workspace);
|
|
1877
|
-
assert.equal(def, def2);
|
|
1878
|
-
} finally {
|
|
1879
|
-
workspaceTeardown.call(this, workspace);
|
|
1880
|
-
}
|
|
1881
|
-
});
|
|
1882
|
-
});
|
|
1883
|
-
|
|
1884
|
-
suite('Mutation', function () {
|
|
1885
|
-
setup(function () {
|
|
1886
|
-
this.defBlock = Blockly.serialization.blocks.append(
|
|
1887
|
-
{
|
|
1888
|
-
'type': testSuite.defType,
|
|
1889
|
-
'fields': {
|
|
1890
|
-
'NAME': 'proc name',
|
|
1891
|
-
},
|
|
1892
|
-
},
|
|
1893
|
-
this.workspace,
|
|
1894
|
-
);
|
|
1895
|
-
this.callBlock = Blockly.serialization.blocks.append(
|
|
1896
|
-
{
|
|
1897
|
-
'type': testSuite.callType,
|
|
1898
|
-
'extraState': {
|
|
1899
|
-
'name': 'proc name',
|
|
1900
|
-
},
|
|
1901
|
-
},
|
|
1902
|
-
this.workspace,
|
|
1903
|
-
);
|
|
1904
|
-
});
|
|
1905
|
-
suite('Composition', function () {
|
|
1906
|
-
suite('Statements', function () {
|
|
1907
|
-
function setStatementValue(mainWorkspace, defBlock, value) {
|
|
1908
|
-
const mutatorWorkspace = new Blockly.Workspace(
|
|
1909
|
-
new Blockly.Options({
|
|
1910
|
-
parentWorkspace: mainWorkspace,
|
|
1911
|
-
}),
|
|
1912
|
-
);
|
|
1913
|
-
defBlock.decompose(mutatorWorkspace);
|
|
1914
|
-
const containerBlock = mutatorWorkspace.getTopBlocks()[0];
|
|
1915
|
-
const statementField = containerBlock.getField('STATEMENTS');
|
|
1916
|
-
statementField.setValue(value);
|
|
1917
|
-
defBlock.compose(containerBlock);
|
|
1918
|
-
}
|
|
1919
|
-
if (testSuite.defType === 'procedures_defreturn') {
|
|
1920
|
-
test('Has Statements', function () {
|
|
1921
|
-
setStatementValue(this.workspace, this.defBlock, true);
|
|
1922
|
-
assert.isTrue(this.defBlock.hasStatements_);
|
|
1923
|
-
});
|
|
1924
|
-
test('Has No Statements', function () {
|
|
1925
|
-
setStatementValue(this.workspace, this.defBlock, false);
|
|
1926
|
-
assert.isFalse(this.defBlock.hasStatements_);
|
|
1927
|
-
});
|
|
1928
|
-
test('Saving Statements', function () {
|
|
1929
|
-
const blockXml = Blockly.utils.xml.textToDom(
|
|
1930
|
-
'<block type="procedures_defreturn">' +
|
|
1931
|
-
' <statement name="STACK">' +
|
|
1932
|
-
' <block type="procedures_ifreturn" id="test"></block>' +
|
|
1933
|
-
' </statement> ' +
|
|
1934
|
-
'</block>',
|
|
1935
|
-
);
|
|
1936
|
-
const defBlock = Blockly.Xml.domToBlock(
|
|
1937
|
-
blockXml,
|
|
1938
|
-
this.workspace,
|
|
1939
|
-
);
|
|
1940
|
-
setStatementValue(this.workspace, defBlock, false);
|
|
1941
|
-
assert.isNull(defBlock.getInput('STACK'));
|
|
1942
|
-
setStatementValue(this.workspace, defBlock, true);
|
|
1943
|
-
assert.isNotNull(defBlock.getInput('STACK'));
|
|
1944
|
-
const statementBlocks = defBlock.getChildren();
|
|
1945
|
-
assert.equal(statementBlocks.length, 1);
|
|
1946
|
-
const block = statementBlocks[0];
|
|
1947
|
-
assert.equal(block.type, 'procedures_ifreturn');
|
|
1948
|
-
assert.equal(block.id, 'test');
|
|
1949
|
-
});
|
|
1950
|
-
}
|
|
1951
|
-
});
|
|
1952
|
-
suite('Untyped Arguments', function () {
|
|
1953
|
-
async function createMutator(argArray) {
|
|
1954
|
-
const mutatorIcon = this.defBlock.getIcon(
|
|
1955
|
-
Blockly.icons.MutatorIcon.TYPE,
|
|
1956
|
-
);
|
|
1957
|
-
await mutatorIcon.setBubbleVisible(true);
|
|
1958
|
-
this.mutatorWorkspace = mutatorIcon.getWorkspace();
|
|
1959
|
-
this.containerBlock = this.mutatorWorkspace.getTopBlocks()[0];
|
|
1960
|
-
this.connection =
|
|
1961
|
-
this.containerBlock.getInput('STACK').connection;
|
|
1962
|
-
for (let i = 0; i < argArray.length; i++) {
|
|
1963
|
-
this.argBlock = this.mutatorWorkspace.newBlock(
|
|
1964
|
-
'procedures_mutatorarg',
|
|
1965
|
-
);
|
|
1966
|
-
this.argBlock.setFieldValue(argArray[i], 'NAME');
|
|
1967
|
-
this.connection.connect(this.argBlock.previousConnection);
|
|
1968
|
-
this.connection = this.argBlock.nextConnection;
|
|
1969
|
-
}
|
|
1970
|
-
this.clock.runAll();
|
|
1971
|
-
}
|
|
1972
|
-
function assertArgs(argArray) {
|
|
1973
|
-
assert.equal(
|
|
1974
|
-
this.defBlock.getVars().length,
|
|
1975
|
-
argArray.length,
|
|
1976
|
-
'Expected the def to have the right number of arguments',
|
|
1977
|
-
);
|
|
1978
|
-
for (let i = 0; i < argArray.length; i++) {
|
|
1979
|
-
assert.equal(this.defBlock.getVars()[i], argArray[i]);
|
|
1980
|
-
}
|
|
1981
|
-
assert.equal(
|
|
1982
|
-
this.callBlock.getVars().length,
|
|
1983
|
-
argArray.length,
|
|
1984
|
-
'Expected the call to have the right number of arguments',
|
|
1985
|
-
);
|
|
1986
|
-
for (let i = 0; i < argArray.length; i++) {
|
|
1987
|
-
assert.equal(this.callBlock.getVars()[i], argArray[i]);
|
|
1988
|
-
}
|
|
1989
|
-
}
|
|
1990
|
-
test('Simple Add Arg', async function () {
|
|
1991
|
-
const args = ['arg1'];
|
|
1992
|
-
await createMutator.call(this, args);
|
|
1993
|
-
assertArgs.call(this, args);
|
|
1994
|
-
});
|
|
1995
|
-
test('Multiple Args', async function () {
|
|
1996
|
-
const args = ['arg1', 'arg2', 'arg3'];
|
|
1997
|
-
await createMutator.call(this, args);
|
|
1998
|
-
assertArgs.call(this, args);
|
|
1999
|
-
});
|
|
2000
|
-
test('Simple Change Arg', async function () {
|
|
2001
|
-
await createMutator.call(this, ['arg1']);
|
|
2002
|
-
this.argBlock.setFieldValue('arg2', 'NAME');
|
|
2003
|
-
this.defBlock.compose(this.containerBlock);
|
|
2004
|
-
assertArgs.call(this, ['arg2']);
|
|
2005
|
-
});
|
|
2006
|
-
test('lower -> CAPS', async function () {
|
|
2007
|
-
await createMutator.call(this, ['arg']);
|
|
2008
|
-
this.argBlock.setFieldValue('ARG', 'NAME');
|
|
2009
|
-
this.defBlock.compose(this.containerBlock);
|
|
2010
|
-
assertArgs.call(this, ['ARG']);
|
|
2011
|
-
});
|
|
2012
|
-
test('CAPS -> lower', async function () {
|
|
2013
|
-
await createMutator.call(this, ['ARG']);
|
|
2014
|
-
this.argBlock.setFieldValue('arg', 'NAME');
|
|
2015
|
-
this.defBlock.compose(this.containerBlock);
|
|
2016
|
-
assertArgs.call(this, ['arg']);
|
|
2017
|
-
});
|
|
2018
|
-
// Test case for #1958
|
|
2019
|
-
test('Set Arg Empty', async function () {
|
|
2020
|
-
const args = ['arg1'];
|
|
2021
|
-
await createMutator.call(this, args);
|
|
2022
|
-
this.argBlock.setFieldValue('', 'NAME');
|
|
2023
|
-
this.defBlock.compose(this.containerBlock);
|
|
2024
|
-
assertArgs.call(this, args);
|
|
2025
|
-
});
|
|
2026
|
-
test('Whitespace', async function () {
|
|
2027
|
-
const args = ['arg1'];
|
|
2028
|
-
await createMutator.call(this, args);
|
|
2029
|
-
this.argBlock.setFieldValue(' ', 'NAME');
|
|
2030
|
-
this.defBlock.compose(this.containerBlock);
|
|
2031
|
-
assertArgs.call(this, args);
|
|
2032
|
-
});
|
|
2033
|
-
test('Whitespace and Text', async function () {
|
|
2034
|
-
await createMutator.call(this, ['arg1']);
|
|
2035
|
-
this.argBlock.setFieldValue(' text ', 'NAME');
|
|
2036
|
-
this.defBlock.compose(this.containerBlock);
|
|
2037
|
-
assertArgs.call(this, ['text']);
|
|
2038
|
-
});
|
|
2039
|
-
test('<>', async function () {
|
|
2040
|
-
const args = ['<>'];
|
|
2041
|
-
await createMutator.call(this, args);
|
|
2042
|
-
assertArgs.call(this, args);
|
|
2043
|
-
});
|
|
2044
|
-
});
|
|
2045
|
-
});
|
|
2046
|
-
suite('Decomposition', function () {
|
|
2047
|
-
suite('Statements', function () {
|
|
2048
|
-
if (testSuite.defType === 'procedures_defreturn') {
|
|
2049
|
-
test('Has Statement Input', function () {
|
|
2050
|
-
const mutatorWorkspace = new Blockly.Workspace(
|
|
2051
|
-
new Blockly.Options({
|
|
2052
|
-
parentWorkspace: this.workspace,
|
|
2053
|
-
}),
|
|
2054
|
-
);
|
|
2055
|
-
this.defBlock.decompose(mutatorWorkspace);
|
|
2056
|
-
const statementInput = mutatorWorkspace
|
|
2057
|
-
.getTopBlocks()[0]
|
|
2058
|
-
.getInput('STATEMENT_INPUT');
|
|
2059
|
-
assert.isNotNull(statementInput);
|
|
2060
|
-
});
|
|
2061
|
-
test('Has Statements', function () {
|
|
2062
|
-
this.defBlock.hasStatements_ = true;
|
|
2063
|
-
const mutatorWorkspace = new Blockly.Workspace(
|
|
2064
|
-
new Blockly.Options({
|
|
2065
|
-
parentWorkspace: this.workspace,
|
|
2066
|
-
}),
|
|
2067
|
-
);
|
|
2068
|
-
this.defBlock.decompose(mutatorWorkspace);
|
|
2069
|
-
const statementValue = mutatorWorkspace
|
|
2070
|
-
.getTopBlocks()[0]
|
|
2071
|
-
.getField('STATEMENTS')
|
|
2072
|
-
.getValueBoolean();
|
|
2073
|
-
assert.isTrue(statementValue);
|
|
2074
|
-
});
|
|
2075
|
-
test('No Has Statements', function () {
|
|
2076
|
-
this.defBlock.hasStatements_ = false;
|
|
2077
|
-
const mutatorWorkspace = new Blockly.Workspace(
|
|
2078
|
-
new Blockly.Options({
|
|
2079
|
-
parentWorkspace: this.workspace,
|
|
2080
|
-
}),
|
|
2081
|
-
);
|
|
2082
|
-
this.defBlock.decompose(mutatorWorkspace);
|
|
2083
|
-
const statementValue = mutatorWorkspace
|
|
2084
|
-
.getTopBlocks()[0]
|
|
2085
|
-
.getField('STATEMENTS')
|
|
2086
|
-
.getValueBoolean();
|
|
2087
|
-
assert.isFalse(statementValue);
|
|
2088
|
-
});
|
|
2089
|
-
} else {
|
|
2090
|
-
test('Has no Statement Input', function () {
|
|
2091
|
-
const mutatorWorkspace = new Blockly.Workspace(
|
|
2092
|
-
new Blockly.Options({
|
|
2093
|
-
parentWorkspace: this.workspace,
|
|
2094
|
-
}),
|
|
2095
|
-
);
|
|
2096
|
-
this.defBlock.decompose(mutatorWorkspace);
|
|
2097
|
-
const statementInput = mutatorWorkspace
|
|
2098
|
-
.getTopBlocks()[0]
|
|
2099
|
-
.getInput('STATEMENT_INPUT');
|
|
2100
|
-
assert.isNull(statementInput);
|
|
2101
|
-
});
|
|
2102
|
-
}
|
|
2103
|
-
});
|
|
2104
|
-
});
|
|
2105
|
-
});
|
|
2106
|
-
/**
|
|
2107
|
-
* Test cases for serialization tests.
|
|
2108
|
-
* @type {Array<SerializationTestCase>}
|
|
2109
|
-
*/
|
|
2110
|
-
const testCases = [
|
|
2111
|
-
{
|
|
2112
|
-
title: 'XML - Minimal definition',
|
|
2113
|
-
xml: '<block type="' + testSuite.defType + '"/>',
|
|
2114
|
-
expectedXml:
|
|
2115
|
-
'<block xmlns="https://developers.google.com/blockly/xml" ' +
|
|
2116
|
-
'type="' +
|
|
2117
|
-
testSuite.defType +
|
|
2118
|
-
'" id="1">\n' +
|
|
2119
|
-
' <field name="NAME">unnamed</field>\n' +
|
|
2120
|
-
'</block>',
|
|
2121
|
-
assertBlockStructure: (block) => {
|
|
2122
|
-
assertDefBlockStructure(block, testSuite.hasReturn);
|
|
2123
|
-
},
|
|
2124
|
-
},
|
|
2125
|
-
{
|
|
2126
|
-
title: 'XML - Common definition',
|
|
2127
|
-
xml:
|
|
2128
|
-
'<block type="' +
|
|
2129
|
-
testSuite.defType +
|
|
2130
|
-
'">' +
|
|
2131
|
-
' <field name="NAME">do something</field>' +
|
|
2132
|
-
'</block>',
|
|
2133
|
-
expectedXml:
|
|
2134
|
-
'<block xmlns="https://developers.google.com/blockly/xml" ' +
|
|
2135
|
-
'type="' +
|
|
2136
|
-
testSuite.defType +
|
|
2137
|
-
'" id="1">\n' +
|
|
2138
|
-
' <field name="NAME">do something</field>\n' +
|
|
2139
|
-
'</block>',
|
|
2140
|
-
assertBlockStructure: (block) => {
|
|
2141
|
-
assertDefBlockStructure(block, testSuite.hasReturn);
|
|
2142
|
-
},
|
|
2143
|
-
},
|
|
2144
|
-
{
|
|
2145
|
-
title: 'XML - With vars definition',
|
|
2146
|
-
xml:
|
|
2147
|
-
'<block type="' +
|
|
2148
|
-
testSuite.defType +
|
|
2149
|
-
'">\n' +
|
|
2150
|
-
' <mutation>\n' +
|
|
2151
|
-
' <arg name="x" varid="arg1"></arg>\n' +
|
|
2152
|
-
' <arg name="y" varid="arg2"></arg>\n' +
|
|
2153
|
-
' </mutation>\n' +
|
|
2154
|
-
' <field name="NAME">do something</field>\n' +
|
|
2155
|
-
'</block>',
|
|
2156
|
-
expectedXml:
|
|
2157
|
-
'<block xmlns="https://developers.google.com/blockly/xml" ' +
|
|
2158
|
-
'type="' +
|
|
2159
|
-
testSuite.defType +
|
|
2160
|
-
'" id="1">\n' +
|
|
2161
|
-
' <mutation>\n' +
|
|
2162
|
-
' <arg name="x" varid="arg1"></arg>\n' +
|
|
2163
|
-
' <arg name="y" varid="arg2"></arg>\n' +
|
|
2164
|
-
' </mutation>\n' +
|
|
2165
|
-
' <field name="NAME">do something</field>\n' +
|
|
2166
|
-
'</block>',
|
|
2167
|
-
assertBlockStructure: (block) => {
|
|
2168
|
-
assertDefBlockStructure(
|
|
2169
|
-
block,
|
|
2170
|
-
testSuite.hasReturn,
|
|
2171
|
-
['x', 'y'],
|
|
2172
|
-
['arg1', 'arg2'],
|
|
2173
|
-
);
|
|
2174
|
-
},
|
|
2175
|
-
},
|
|
2176
|
-
{
|
|
2177
|
-
title: 'XML - With pre-created vars definition',
|
|
2178
|
-
xml:
|
|
2179
|
-
'<block type="' +
|
|
2180
|
-
testSuite.defType +
|
|
2181
|
-
'">\n' +
|
|
2182
|
-
' <mutation>\n' +
|
|
2183
|
-
' <arg name="preCreatedVar" varid="preCreatedVarId"></arg>\n' +
|
|
2184
|
-
' </mutation>\n' +
|
|
2185
|
-
' <field name="NAME">do something</field>\n' +
|
|
2186
|
-
'</block>',
|
|
2187
|
-
expectedXml:
|
|
2188
|
-
'<block xmlns="https://developers.google.com/blockly/xml" ' +
|
|
2189
|
-
'type="' +
|
|
2190
|
-
testSuite.defType +
|
|
2191
|
-
'" id="1">\n' +
|
|
2192
|
-
' <mutation>\n' +
|
|
2193
|
-
' <arg name="preCreatedVar" varid="preCreatedVarId"></arg>\n' +
|
|
2194
|
-
' </mutation>\n' +
|
|
2195
|
-
' <field name="NAME">do something</field>\n' +
|
|
2196
|
-
'</block>',
|
|
2197
|
-
assertBlockStructure: (block) => {
|
|
2198
|
-
assertDefBlockStructure(
|
|
2199
|
-
block,
|
|
2200
|
-
testSuite.hasReturn,
|
|
2201
|
-
['preCreatedVar'],
|
|
2202
|
-
['preCreatedVarId'],
|
|
2203
|
-
);
|
|
2204
|
-
},
|
|
2205
|
-
},
|
|
2206
|
-
{
|
|
2207
|
-
title: 'XML - No statements definition',
|
|
2208
|
-
xml:
|
|
2209
|
-
'<block type="procedures_defreturn">\n' +
|
|
2210
|
-
' <mutation statements="false"></mutation>\n' +
|
|
2211
|
-
' <field name="NAME">do something</field>\n' +
|
|
2212
|
-
'</block>',
|
|
2213
|
-
expectedXml:
|
|
2214
|
-
'<block xmlns="https://developers.google.com/blockly/xml" ' +
|
|
2215
|
-
'type="procedures_defreturn" id="1">\n' +
|
|
2216
|
-
' <mutation statements="false"></mutation>\n' +
|
|
2217
|
-
' <field name="NAME">do something</field>\n' +
|
|
2218
|
-
'</block>',
|
|
2219
|
-
assertBlockStructure: (block) => {
|
|
2220
|
-
assertDefBlockStructure(block, true, [], [], false);
|
|
2221
|
-
},
|
|
2222
|
-
},
|
|
2223
|
-
{
|
|
2224
|
-
title: 'XML - Minimal caller',
|
|
2225
|
-
xml: '<block type="' + testSuite.callType + '"/>',
|
|
2226
|
-
expectedXml:
|
|
2227
|
-
'<block xmlns="https://developers.google.com/blockly/xml" ' +
|
|
2228
|
-
'type="' +
|
|
2229
|
-
testSuite.callType +
|
|
2230
|
-
'" id="1">\n' +
|
|
2231
|
-
' <mutation name="unnamed"></mutation>\n' +
|
|
2232
|
-
'</block>',
|
|
2233
|
-
assertBlockStructure: (block) => {
|
|
2234
|
-
assertCallBlockStructure(block);
|
|
2235
|
-
},
|
|
2236
|
-
},
|
|
2237
|
-
{
|
|
2238
|
-
title: 'XML - Common caller',
|
|
2239
|
-
xml:
|
|
2240
|
-
'<block type="' +
|
|
2241
|
-
testSuite.callType +
|
|
2242
|
-
'">\n' +
|
|
2243
|
-
' <mutation name="do something"/>\n' +
|
|
2244
|
-
'</block>',
|
|
2245
|
-
expectedXml:
|
|
2246
|
-
'<block xmlns="https://developers.google.com/blockly/xml" ' +
|
|
2247
|
-
'type="' +
|
|
2248
|
-
testSuite.callType +
|
|
2249
|
-
'" id="1">\n' +
|
|
2250
|
-
' <mutation name="do something"></mutation>\n' +
|
|
2251
|
-
'</block>',
|
|
2252
|
-
assertBlockStructure: (block) => {
|
|
2253
|
-
assertCallBlockStructure(block);
|
|
2254
|
-
},
|
|
2255
|
-
},
|
|
2256
|
-
{
|
|
2257
|
-
title: 'XML - With pre-created vars caller',
|
|
2258
|
-
xml:
|
|
2259
|
-
'<block type="' +
|
|
2260
|
-
testSuite.callType +
|
|
2261
|
-
'">\n' +
|
|
2262
|
-
' <mutation name="do something">\n' +
|
|
2263
|
-
' <arg name="preCreatedVar"></arg>\n' +
|
|
2264
|
-
' </mutation>\n' +
|
|
2265
|
-
'</block>',
|
|
2266
|
-
expectedXml:
|
|
2267
|
-
'<block xmlns="https://developers.google.com/blockly/xml" ' +
|
|
2268
|
-
'type="' +
|
|
2269
|
-
testSuite.callType +
|
|
2270
|
-
'" id="1">\n' +
|
|
2271
|
-
' <mutation name="do something">\n' +
|
|
2272
|
-
' <arg name="preCreatedVar"></arg>\n' +
|
|
2273
|
-
' </mutation>\n' +
|
|
2274
|
-
'</block>',
|
|
2275
|
-
assertBlockStructure: (block) => {
|
|
2276
|
-
assertCallBlockStructure(
|
|
2277
|
-
block,
|
|
2278
|
-
['preCreatedVar'],
|
|
2279
|
-
['preCreatedVarId'],
|
|
2280
|
-
);
|
|
2281
|
-
},
|
|
2282
|
-
},
|
|
2283
|
-
{
|
|
2284
|
-
title: 'JSON - Minimal definition',
|
|
2285
|
-
json: {
|
|
2286
|
-
'type': testSuite.defType,
|
|
2287
|
-
},
|
|
2288
|
-
expectedJson: {
|
|
2289
|
-
'type': testSuite.defType,
|
|
2290
|
-
'id': '1',
|
|
2291
|
-
'fields': {
|
|
2292
|
-
'NAME': 'unnamed',
|
|
2293
|
-
},
|
|
2294
|
-
},
|
|
2295
|
-
assertBlockStructure: (block) => {
|
|
2296
|
-
assertDefBlockStructure(block, testSuite.hasReturn);
|
|
2297
|
-
},
|
|
2298
|
-
},
|
|
2299
|
-
{
|
|
2300
|
-
title: 'JSON - Common definition',
|
|
2301
|
-
json: {
|
|
2302
|
-
'type': testSuite.defType,
|
|
2303
|
-
'fields': {
|
|
2304
|
-
'NAME': 'do something',
|
|
2305
|
-
},
|
|
2306
|
-
},
|
|
2307
|
-
expectedJson: {
|
|
2308
|
-
'type': testSuite.defType,
|
|
2309
|
-
'id': '1',
|
|
2310
|
-
'fields': {
|
|
2311
|
-
'NAME': 'do something',
|
|
2312
|
-
},
|
|
2313
|
-
},
|
|
2314
|
-
assertBlockStructure: (block) => {
|
|
2315
|
-
assertDefBlockStructure(block, testSuite.hasReturn);
|
|
2316
|
-
},
|
|
2317
|
-
},
|
|
2318
|
-
{
|
|
2319
|
-
title: 'JSON - With vars definition',
|
|
2320
|
-
json: {
|
|
2321
|
-
'type': testSuite.defType,
|
|
2322
|
-
'fields': {
|
|
2323
|
-
'NAME': 'do something',
|
|
2324
|
-
},
|
|
2325
|
-
'extraState': {
|
|
2326
|
-
'params': [
|
|
2327
|
-
{
|
|
2328
|
-
'name': 'x',
|
|
2329
|
-
'id': 'arg1',
|
|
2330
|
-
},
|
|
2331
|
-
{
|
|
2332
|
-
'name': 'y',
|
|
2333
|
-
'id': 'arg2',
|
|
2334
|
-
},
|
|
2335
|
-
],
|
|
2336
|
-
},
|
|
2337
|
-
},
|
|
2338
|
-
expectedJson: {
|
|
2339
|
-
'type': testSuite.defType,
|
|
2340
|
-
'id': '1',
|
|
2341
|
-
'fields': {
|
|
2342
|
-
'NAME': 'do something',
|
|
2343
|
-
},
|
|
2344
|
-
'extraState': {
|
|
2345
|
-
'params': [
|
|
2346
|
-
{
|
|
2347
|
-
'name': 'x',
|
|
2348
|
-
'id': 'arg1',
|
|
2349
|
-
},
|
|
2350
|
-
{
|
|
2351
|
-
'name': 'y',
|
|
2352
|
-
'id': 'arg2',
|
|
2353
|
-
},
|
|
2354
|
-
],
|
|
2355
|
-
},
|
|
2356
|
-
},
|
|
2357
|
-
assertBlockStructure: (block) => {
|
|
2358
|
-
assertDefBlockStructure(
|
|
2359
|
-
block,
|
|
2360
|
-
testSuite.hasReturn,
|
|
2361
|
-
['x', 'y'],
|
|
2362
|
-
['arg1', 'arg2'],
|
|
2363
|
-
);
|
|
2364
|
-
},
|
|
2365
|
-
},
|
|
2366
|
-
{
|
|
2367
|
-
title: 'JSON - With pre-created vars definition',
|
|
2368
|
-
json: {
|
|
2369
|
-
'type': testSuite.defType,
|
|
2370
|
-
'extraState': {
|
|
2371
|
-
'params': [
|
|
2372
|
-
{
|
|
2373
|
-
'name': 'preCreatedVar',
|
|
2374
|
-
'id': 'preCreatedVarId',
|
|
2375
|
-
},
|
|
2376
|
-
],
|
|
2377
|
-
},
|
|
2378
|
-
'fields': {
|
|
2379
|
-
'NAME': 'do something',
|
|
2380
|
-
},
|
|
2381
|
-
},
|
|
2382
|
-
expectedJson: {
|
|
2383
|
-
'type': testSuite.defType,
|
|
2384
|
-
'id': '1',
|
|
2385
|
-
'fields': {
|
|
2386
|
-
'NAME': 'do something',
|
|
2387
|
-
},
|
|
2388
|
-
'extraState': {
|
|
2389
|
-
'params': [
|
|
2390
|
-
{
|
|
2391
|
-
'name': 'preCreatedVar',
|
|
2392
|
-
'id': 'preCreatedVarId',
|
|
2393
|
-
},
|
|
2394
|
-
],
|
|
2395
|
-
},
|
|
2396
|
-
},
|
|
2397
|
-
assertBlockStructure: (block) => {
|
|
2398
|
-
assertDefBlockStructure(
|
|
2399
|
-
block,
|
|
2400
|
-
testSuite.hasReturn,
|
|
2401
|
-
['preCreatedVar'],
|
|
2402
|
-
['preCreatedVarId'],
|
|
2403
|
-
);
|
|
2404
|
-
},
|
|
2405
|
-
},
|
|
2406
|
-
{
|
|
2407
|
-
title: 'JSON - No statements definition',
|
|
2408
|
-
json: {
|
|
2409
|
-
'type': 'procedures_defreturn',
|
|
2410
|
-
'fields': {
|
|
2411
|
-
'NAME': 'do something',
|
|
2412
|
-
},
|
|
2413
|
-
'extraState': {
|
|
2414
|
-
'hasStatements': false,
|
|
2415
|
-
},
|
|
2416
|
-
},
|
|
2417
|
-
expectedJson: {
|
|
2418
|
-
'type': 'procedures_defreturn',
|
|
2419
|
-
'id': '1',
|
|
2420
|
-
'fields': {
|
|
2421
|
-
'NAME': 'do something',
|
|
2422
|
-
},
|
|
2423
|
-
'extraState': {
|
|
2424
|
-
'hasStatements': false,
|
|
2425
|
-
},
|
|
2426
|
-
},
|
|
2427
|
-
assertBlockStructure: (block) => {
|
|
2428
|
-
assertDefBlockStructure(block, true, [], [], false);
|
|
2429
|
-
},
|
|
2430
|
-
},
|
|
2431
|
-
{
|
|
2432
|
-
title: 'JSON - Minimal caller',
|
|
2433
|
-
json: {
|
|
2434
|
-
'type': testSuite.callType,
|
|
2435
|
-
},
|
|
2436
|
-
expectedJson: {
|
|
2437
|
-
'type': testSuite.callType,
|
|
2438
|
-
'id': '1',
|
|
2439
|
-
'extraState': {
|
|
2440
|
-
'name': 'unnamed',
|
|
2441
|
-
},
|
|
2442
|
-
},
|
|
2443
|
-
assertBlockStructure: (block) => {
|
|
2444
|
-
assertCallBlockStructure(block);
|
|
2445
|
-
},
|
|
2446
|
-
},
|
|
2447
|
-
{
|
|
2448
|
-
title: 'JSON - Common caller',
|
|
2449
|
-
json: {
|
|
2450
|
-
'type': testSuite.callType,
|
|
2451
|
-
'extraState': {
|
|
2452
|
-
'name': 'do something',
|
|
2453
|
-
},
|
|
2454
|
-
},
|
|
2455
|
-
expectedJson: {
|
|
2456
|
-
'type': testSuite.callType,
|
|
2457
|
-
'id': '1',
|
|
2458
|
-
'extraState': {
|
|
2459
|
-
'name': 'do something',
|
|
2460
|
-
},
|
|
2461
|
-
},
|
|
2462
|
-
assertBlockStructure: (block) => {
|
|
2463
|
-
assertCallBlockStructure(block);
|
|
2464
|
-
},
|
|
2465
|
-
},
|
|
2466
|
-
{
|
|
2467
|
-
title: 'JSON - With pre-created vars caller',
|
|
2468
|
-
json: {
|
|
2469
|
-
'type': testSuite.callType,
|
|
2470
|
-
'extraState': {
|
|
2471
|
-
'name': 'do something',
|
|
2472
|
-
'params': ['preCreatedVar'],
|
|
2473
|
-
},
|
|
2474
|
-
},
|
|
2475
|
-
expectedJson: {
|
|
2476
|
-
'type': testSuite.callType,
|
|
2477
|
-
'id': '1',
|
|
2478
|
-
'extraState': {
|
|
2479
|
-
'name': 'do something',
|
|
2480
|
-
'params': ['preCreatedVar'],
|
|
2481
|
-
},
|
|
2482
|
-
},
|
|
2483
|
-
assertBlockStructure: (block) => {
|
|
2484
|
-
assertCallBlockStructure(
|
|
2485
|
-
block,
|
|
2486
|
-
['preCreatedVar'],
|
|
2487
|
-
['preCreatedVarId'],
|
|
2488
|
-
);
|
|
2489
|
-
},
|
|
2490
|
-
},
|
|
2491
|
-
];
|
|
2492
|
-
runSerializationTestSuite(testCases);
|
|
2493
|
-
});
|
|
2494
|
-
});
|
|
2495
|
-
});
|