-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Migrate core/registry.js to goog.module syntax #5217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate core/registry.js to goog.module syntax #5217
Conversation
core/registry.js
Outdated
| throw Error( | ||
| 'Invalid type "' + type + '". The type must be a' + | ||
| ' non-empty string or a Blockly.registry.Type.'); | ||
| ' non-empty string or a Type.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this error message should retain the namespace for legibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, updated.
| */ | ||
| this.name_ = name; | ||
| }; | ||
| exports.Type = Type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it may be one of the cases where Type ought to be a class in its own file and moved out of this one, and we should add it to the list of weird files to follow up on. Because this isn't just a static function on the registry namespace like many of the other files have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a note about this to the tracking issue, I agree it seems reasonable to split it out into its own file.
The basics
goog_modulegoog_moduleconversion guide
npm test.The details
Resolves
Part of #5026
Proposed Changes
Converts
core/registry.jstogoog.modulewith ES6const/let.