feat: make the variable map return early for noops (#6674)

* chore: add variable map tests

* chore: move firing create events into the variable map

* feat: add early returning in the case of noop renames

* chore: format
This commit is contained in:
Beka Westberg
2022-12-02 08:10:41 -08:00
committed by GitHub
parent 67275e4bba
commit fc2c10d0d0
3 changed files with 203 additions and 3 deletions

View File

@@ -15,7 +15,6 @@ goog.declareModuleId('Blockly.VariableModel');
// Unused import preserved for side-effects. Remove if unneeded.
import './events/events_var_create.js';
import * as eventUtils from './events/utils.js';
import * as idGenerator from './utils/idgenerator.js';
import type {Workspace} from './workspace.js';
@@ -58,8 +57,6 @@ export class VariableModel {
* UUID.
*/
this.id_ = opt_id || idGenerator.genUid();
eventUtils.fire(new (eventUtils.get(eventUtils.VAR_CREATE))(this));
}
/** @returns The ID for the variable. */