Skip to content

Commit

Permalink
refactor: convert blocksvg and block to ES6 classes (google#5952)
Browse files Browse the repository at this point in the history
* refact: move super call to top of block svg

* refact: run conversion script on block svg and block

* fix: make debug build happy

* fix: tests

* style: format

* fix: cleanup from rebase

* fix: use new.target instead of a new parameter

* fix: add more overridden casted methods to BlockSvg

* style: fix typos

* style: move override tags to the end of JSDoc

* fix: cleanup from rebase
  • Loading branch information
BeksOmega authored Feb 28, 2022
1 parent cb4521b commit fa14e9d
Show file tree
Hide file tree
Showing 22 changed files with 3,546 additions and 3,349 deletions.
3,669 changes: 1,866 additions & 1,803 deletions core/block.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion core/block_dragger.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ const BlockDragger = class {
const initIconData = function(block) {
// Build a list of icons that need to be moved and where they started.
const dragIconData = [];
const descendants = block.getDescendants(false);
const descendants =
/** @type {!Array<!BlockSvg>} */ (block.getDescendants(false));

for (let i = 0, descendant; (descendant = descendants[i]); i++) {
const icons = descendant.getIcons();
Expand Down
Loading

0 comments on commit fa14e9d

Please sign in to comment.