mirror of
https://github.com/google/blockly.git
synced 2025-12-16 06:10:12 +01:00
fix: Allow reregistering fields. (#9290)
This commit is contained in:
@@ -56,11 +56,11 @@ export interface RegistrableField {
|
||||
* @param type The field type name as used in the JSON definition.
|
||||
* @param fieldClass The field class containing a fromJson function that can
|
||||
* construct an instance of the field.
|
||||
* @throws {Error} if the type name is empty, the field is already registered,
|
||||
* or the fieldClass is not an object containing a fromJson function.
|
||||
* @throws {Error} if the type name is empty or the fieldClass is not an object
|
||||
* containing a fromJson function.
|
||||
*/
|
||||
export function register(type: string, fieldClass: RegistrableField) {
|
||||
registry.register(registry.Type.FIELD, type, fieldClass);
|
||||
registry.register(registry.Type.FIELD, type, fieldClass, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user