Migrate core/field_label_serializable.js named requires

This commit is contained in:
kozbial
2021-07-21 15:45:51 -07:00
committed by Monica Kozbial
parent 20ef2462b5
commit bcb57b7efd

View File

@@ -14,10 +14,10 @@
goog.module('Blockly.FieldLabelSerializable');
goog.module.declareLegacyNamespace();
goog.require('Blockly.FieldLabel');
goog.require('Blockly.fieldRegistry');
goog.require('Blockly.utils');
goog.require('Blockly.utils.object');
const FieldLabel = goog.require('Blockly.FieldLabel');
const fieldRegistry = goog.require('Blockly.fieldRegistry');
const {inherits} = goog.require('Blockly.utils.object');
const {replaceMessageReferences} = goog.require('Blockly.utils');
/**
@@ -28,7 +28,7 @@ goog.require('Blockly.utils.object');
* @param {Object=} opt_config A map of options used to configure the field.
* See the [field creation documentation]{@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/label-serializable#creation}
* for a list of properties this parameter supports.
* @extends {Blockly.FieldLabel}
* @extends {FieldLabel}
* @constructor
*
*/
@@ -36,8 +36,8 @@ const FieldLabelSerializable = function(opt_value, opt_class, opt_config) {
FieldLabelSerializable.superClass_.constructor.call(
this, opt_value, opt_class, opt_config);
};
Blockly.utils.object.inherits(FieldLabelSerializable,
Blockly.FieldLabel);
inherits(FieldLabelSerializable,
FieldLabel);
/**
* Construct a FieldLabelSerializable from a JSON arg object,
@@ -48,7 +48,7 @@ Blockly.utils.object.inherits(FieldLabelSerializable,
* @nocollapse
*/
FieldLabelSerializable.fromJson = function(options) {
const text = Blockly.utils.replaceMessageReferences(options['text']);
const text = replaceMessageReferences(options['text']);
// `this` might be a subclass of FieldLabelSerializable if that class doesn't
// override the static fromJson method.
return new this(text, undefined, options);
@@ -68,7 +68,7 @@ FieldLabelSerializable.prototype.EDITABLE = false;
*/
FieldLabelSerializable.prototype.SERIALIZABLE = true;
Blockly.fieldRegistry.register(
fieldRegistry.register(
'field_label_serializable', FieldLabelSerializable);
exports = FieldLabelSerializable;