Re-add goog.is* functions as Blockly.goog polyfills#241
Merged
Conversation
Re-adds the goog.isDef, goog.isNull, goog.isDefAndNotNull, goog.isString, goog.isBoolean, goog.isNumber, and goog.isFunction functions as polyfills under the Blockly.goog namespace. This change is necessary because these functions were removed from the Closure Library, but Blockly still relies on them. All usages of goog.is* in the affected Blockly core files have been updated to use Blockly.goog.is* instead. Session summary: > Find all usages of goog.is(Def|Null|DefAndNotNull|String|Boolean|Number) (regex) Found 10 matches in 7 files under static/third_party/lib/blockly/core/. > Those functions were deleted by the library. Create a new file with those functions in that directory, using google/closure-library@9325ce1 as a reference, and then replace all usages in those files with the new definition. Created a new file static/third_party/lib/blockly/core/goog-polyfill.js with the specified functions and updated 7 files to use the new polyfills. > That's generally good, but rename the file to goog-polyfill.js Renamed the file as requested. > Also make sure the functions are defined in the Blockly namespace Moved the functions into the `Blockly.goog` namespace and updated the calls in the 7 files. > Also define isFunction Added `Blockly.goog.isFunction` to the polyfill file and updated its usage in an additional file, `field_dropdown.js`.
Collaborator
Author
|
Fixes #240 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-adds the goog.isDef, goog.isNull, goog.isDefAndNotNull, goog.isString, goog.isBoolean, goog.isNumber, and goog.isFunction functions as polyfills under the Blockly.goog namespace.
This change is necessary because these functions were removed from the Closure Library, but this version of Blockly still relies on them.
All usages of goog.is* in the affected Blockly core files have been updated to use Blockly.goog.is* instead.
Mostly this did via the gemini CLI: summary of the session:
Session summary: