Migrate core/widgetdiv.js to goog.module syntax (#5331)

* Migrate core/widgetdiv.js to ES6 const/let

* Migrate core/widgetdiv.js to goog.module

* Migrate core/widgetdiv.js to named requires

* clang-format core/widgetdiv.js

* Mark WidgetDiv.DIV as deprecated and refactor callers to use setters/getters

* Fix deprecation date

* Refactor tests to make setDiv() in core/widgetdiv.js test-only

* Fix type annotations for WidgetDiv.DIV and move test cleanup into sharedTestTeardown
This commit is contained in:
Aaron Dodson
2021-08-16 10:23:50 -07:00
committed by GitHub
parent 26195a6d9c
commit 9046ce165b
9 changed files with 133 additions and 96 deletions

View File

@@ -40,7 +40,7 @@ suite('WidgetDiv', function() {
anchorBBox, rtl, expectedX, expectedY, expectedHeight) {
Blockly.WidgetDiv.positionWithAnchor(
this.viewportBBox, anchorBBox, this.widgetSize, rtl);
var style = Blockly.WidgetDiv.DIV.style;
var style = Blockly.WidgetDiv.getDiv().style;
chai.assert.equal(style.left, expectedX + 'px', 'Left');
chai.assert.equal(style.top, expectedY + 'px', 'Top');
chai.assert.equal(style.height, expectedHeight + 'px', 'Height');