refactor: convert blocksvg and block to ES6 classes (#5952)

* 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
This commit is contained in:
Beka Westberg
2022-02-28 09:48:37 -08:00
committed by GitHub
parent cb4521b645
commit fa14e9d6de
22 changed files with 3987 additions and 3790 deletions

View File

@@ -19,7 +19,7 @@
goog.module('Blockly.blockRendering.IPathObject');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
const {BlockSvg} = goog.requireType('Blockly.BlockSvg');
/* eslint-disable-next-line no-unused-vars */
const {ConstantProvider} = goog.requireType('Blockly.blockRendering.ConstantProvider');
/* eslint-disable-next-line no-unused-vars */
@@ -78,7 +78,7 @@ IPathObject.prototype.setPath;
/**
* Apply the stored colours to the block's path, taking into account whether
* the paths belong to a shadow block.
* @param {!Block} block The source block.
* @param {!BlockSvg} block The source block.
* @package
*/
IPathObject.prototype.applyColour;

View File

@@ -18,7 +18,7 @@ goog.module('Blockly.blockRendering.PathObject');
const dom = goog.require('Blockly.utils.dom');
/* eslint-disable-next-line no-unused-vars */
const {Block} = goog.requireType('Blockly.Block');
const {BlockSvg} = goog.requireType('Blockly.BlockSvg');
/* eslint-disable-next-line no-unused-vars */
const {Connection} = goog.requireType('Blockly.Connection');
/* eslint-disable-next-line no-unused-vars */
@@ -144,7 +144,7 @@ class PathObject {
/**
* Apply the stored colours to the block's path, taking into account whether
* the paths belong to a shadow block.
* @param {!Block} block The source block.
* @param {!BlockSvg} block The source block.
* @package
*/
applyColour(block) {