Remove require destructuring (#5294)

This commit is contained in:
Monica Kozbial
2021-08-03 15:07:14 -07:00
committed by GitHub
parent 724cdd3bd2
commit bec82da358
31 changed files with 242 additions and 237 deletions

View File

@@ -16,8 +16,8 @@ goog.module.declareLegacyNamespace();
const ASTNode = goog.require('Blockly.ASTNode');
const Cursor = goog.require('Blockly.Cursor');
const {register, Type} = goog.require('Blockly.registry');
const {inherits} = goog.require('Blockly.utils.object');
const object = goog.require('Blockly.utils.object');
const registry = goog.require('Blockly.registry');
/**
@@ -30,7 +30,7 @@ const {inherits} = goog.require('Blockly.utils.object');
const BasicCursor = function() {
BasicCursor.superClass_.constructor.call(this);
};
inherits(BasicCursor, Cursor);
object.inherits(BasicCursor, Cursor);
/**
* Name used for registering a basic cursor.
@@ -214,6 +214,7 @@ BasicCursor.prototype.getRightMostChild_ = function(node) {
return this.getRightMostChild_(newNode);
};
register(Type.CURSOR, BasicCursor.registrationName, BasicCursor);
registry.register(
registry.Type.CURSOR, BasicCursor.registrationName, BasicCursor);
exports = BasicCursor;

View File

@@ -16,8 +16,8 @@ goog.module.declareLegacyNamespace();
const ASTNode = goog.require('Blockly.ASTNode');
const Marker = goog.require('Blockly.Marker');
const {DEFAULT, register, Type} = goog.require('Blockly.registry');
const {inherits} = goog.require('Blockly.utils.object');
const object = goog.require('Blockly.utils.object');
const registry = goog.require('Blockly.registry');
/**
@@ -34,7 +34,7 @@ const Cursor = function() {
*/
this.type = 'cursor';
};
inherits(Cursor, Marker);
object.inherits(Cursor, Marker);
/**
* Find the next connection, field, or block.
@@ -134,6 +134,6 @@ Cursor.prototype.out = function() {
return newNode;
};
register(Type.CURSOR, DEFAULT, Cursor);
registry.register(registry.Type.CURSOR, registry.DEFAULT, Cursor);
exports = Cursor;

View File

@@ -18,7 +18,7 @@ const ASTNode = goog.require('Blockly.ASTNode');
const BasicCursor = goog.require('Blockly.BasicCursor');
/* eslint-disable-next-line no-unused-vars */
const Field = goog.requireType('Blockly.Field');
const {inherits} = goog.require('Blockly.utils.object');
const object = goog.require('Blockly.utils.object');
/**
@@ -29,7 +29,7 @@ const {inherits} = goog.require('Blockly.utils.object');
const TabNavigateCursor = function() {
TabNavigateCursor.superClass_.constructor.call(this);
};
inherits(TabNavigateCursor, BasicCursor);
object.inherits(TabNavigateCursor, BasicCursor);
/**
* Skip all nodes except for tab navigable fields.