Commit Graph

44 Commits

Author SHA1 Message Date
Rachel Fenichel 26d2b51681 Fix missing require types 2021-02-17 11:17:48 -08:00
Jakub Vrána 00bb99e0ff Add non-nullable modifier to return type of functions never returning null (#3742) 2020-03-16 08:14:47 -07:00
Neil Fraser 4e2f8e6e02 Use SPDX licences.
This is a followup to #3127.
At the time, SPDX licenses were pending approval by Google.
2020-02-11 13:27:20 -08:00
Sam El-Husseini 759875a6c0 Resolve remaining compiler type warnings (#3334)
* Resolve remaining compiler warnings with inconsistent types.
2019-10-25 19:07:17 -04:00
Sam El-Husseini d0772ad496 Fix compiler warnings related to fields. (#3144)
* Fix compiler warnings related to fields.
2019-10-03 15:58:46 -07:00
Neil Fraser b46a4fe286 Bring our license format up to date (#3127)
* Google changed from an Inc to an LLC.

This happened back in 2017 but we didn’t notice.  Officially we should update files from Inc to LLC when they are changed as part of regular edits, but this is a nightmare to remember for the next decade.

* Remove project description/titles from licenses

This is no longer part of Google’s header requirements.  Our existing descriptions were useless (“Visual Blocks Editor”) or grossly obselete (“Visual Blocks Language”).

* License no longer requires URL.

* Fix license regexps.
2019-10-02 14:46:56 -07:00
Neil Fraser 4ed3295ad9 Make generator an optional module (#3105) 2019-09-27 10:47:10 -07:00
Monica Kozbial 22e79ae496 Updating behavior of register functions and adding unregister. (#3085)
* Updating behavior of register functions and adding unregister.

* Updates jsdoc comments.
2019-09-26 13:23:45 -07:00
Neil Fraser 84a814cda1 Make mutator an optional module. (#3048) 2019-09-19 11:39:55 -07:00
Neil Fraser 9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
Neil Fraser 25adb40e66 Prefix and suffix edge cases for flow statements.
Call suffix code on break/continue before executing the break/continue.
Call prefix code for enclosing loop before executing continue.
2019-05-14 17:19:31 -07:00
Neil Fraser e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
Neil Fraser 405b1e4e78 Lint issues found while debugging. 2019-03-27 15:47:29 -07:00
Neil Fraser aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -07:00
Neil Fraser dddb94aedd Fix circular dependency. 2018-10-16 11:34:10 -07:00
Neil Fraser 3909bd420a Remove all goog.asserts and goog.isXxx
First step to reducing Closure’s footprint.
2018-07-11 12:20:02 -07:00
Andrew n marshall f45c6faf05 Fix #1619. buildTooltipWithFieldValue() => buildTooltipWithFieldText() (#1638)
Fix #1619. buildTooltipWithFieldValue() => buildTooltipWithFieldText()

The "value" of FieldVariables was the variable id.
However, we usually want the field text for the human visible tooltip.
Refactoring and renaming buildTooltipWithFieldValue to use the field
text.
2018-02-16 16:51:18 -08:00
Rachel Fenichel 3e62ffc20a Split at higher level for multiline function calls 2018-01-24 11:26:41 -08:00
Rachel Fenichel 9a53e96d53 More lint fixes 2018-01-23 18:22:53 -08:00
Neil Fraser 870f7b7f8a Fix document detection.
Andrew LGTMs in person.
2018-01-08 15:10:14 -08:00
duzc2dtw@gmail.com da429688f8 space between if and ( 2017-12-13 17:02:34 +08:00
duzc2dtw@gmail.com 26ea42c264 #1376 2017-12-09 20:41:43 +08:00
duzc2dtw@gmail.com 0ee877b4bf fix indent 2017-12-09 02:09:58 +08:00
duzc2dtw@gmail.com f770b29491 fix #1173 2017-12-09 02:03:28 +08:00
Neil Fraser 2445a752b7 Resolve another 20 warnings. 2017-10-24 14:06:29 -07:00
Neil Fraser 4262b09002 Resolve 106 warnings. 2017-10-24 14:06:29 -07:00
Neil Fraser 631c978174 Fix typos. 2017-10-20 13:29:23 -07:00
Rachel Fenichel 078b4fceb3 Revert some whitespace changes to appease eslint (#1370) 2017-10-19 16:08:54 -07:00
Neil Fraser 5c00256e96 Style improvements. No functional changes. (#1367) 2017-10-17 15:19:50 -07:00
RoboErikG 26e74f72d6 Missed one use of string instead of .property in extensions.js (#1262) 2017-08-04 11:34:33 -07:00
RoboErikG fab59facee Update extensions.js to be compatible with ADVANCED_OPTIMIZATIONS (#1253)
* Update extensions.js to be compatible with ADVANCED_OPTIMIZATIONS

We were using strings to check for the existence of properties on
a mutator, which breaks if those properties were renamed by the
closure compiler. This updates all of the uses to direct function
references so that anyone building with advanced optimizations turned
on will get the correct method references in their mutators.

fixes #1251

* Update to extensions.js for advanced optimizations

Some minor updates to making extensions.js work with advanced
optimizations.

* use === undefined instead of typeof == 'undefined'
2017-08-03 15:18:41 -07:00
Neil Fraser fc8d4c90b4 Compatibility for Closure Compiler. (#1240) 2017-07-31 09:07:41 -07:00
Rachel Fenichel c30928a177 Make some functions private and add tests 2017-02-24 15:51:59 -08:00
Rachel Fenichel aa8e996799 Handle mutations with both mixins and functions 2017-02-23 17:07:06 -08:00
Rachel Fenichel 4b0c32e91f Add safety checks for mutators and non-mutator extensions 2017-02-23 15:55:13 -08:00
Rachel Fenichel 455432250e Use mutator extension for controls_if block 2017-02-22 17:05:52 -08:00
Andrew n marshall a4cfd5cbc8 Porting Loop blocks to JSON (#919)
* Improved documentation on `Blockly.Extensions.buildTooltipForDropdown`
 * Replaced incorrect uses of `@mixes` JSDoc annotation (on mixin extensions) with `@augments Blockly.Block`.
 * Added Blockly.Extensions.buildTooltipWithFieldValue() extension helper.
2017-02-08 11:36:38 -08:00
Andrew n marshall 15827c5d30 Adds Block.prototype.mixin() and Blockly.Extensions.registerMixin(). (#907)
Adds Block.prototype.mixin() and Blockly.Extensions.registerMixin().
This adds support for a common use pattern in extensions, and adds
error checking to avoid future incompatibilities.
2017-02-06 10:00:08 -08:00
Andrew n marshall e95991cba8 Adding @namespace annotations for JSDoc. (#900) 2017-02-01 09:10:35 -08:00
Tim Dawborn 14ee069543 Remove use of Array.prototype.includes which is not implemented in IE or Edge < 14. Fixes google/blockly#876. 2017-01-27 13:51:18 +11:00
Andrew n marshall 624afeee94 Blockly.Extensions.buildTooltipForDropdown(..): Deferred validation. (#870)
Defer tooltip message string check until after load, when all Blockly.Msg should be loaded.
Avoids validation in headless mode, due to lack of document.readyState.
2017-01-26 15:12:32 -08:00
Andrew n marshall 7b0275cd70 Porting math.js blocks to JSON (#846)
Moving all `math.js` definitions into a single JSON array, complete with i18n syntax for all messages, dropdowns, and tooltips.

Adding Blockly.Extensions.buildTooltipForDropdown(..) to facilitate the creation and error-checking of tooltips that update based on the value of a dropdown.

Now warn on raw string in JSON 'extensions'.
2017-01-23 10:23:55 -08:00
Andrew n marshall 78dc5ed9c2 JSON definitions for colour blocks (#838)
Replaces old colour block definitions with a Blockly.defineBlocksWithJsonArray(..) call. Generator unit tests continue to load and pass, signifying compatibility with prior block definitions.

Replaces extension 'math_number_tooltip' with the reusable 'parent_tooltip_when_inline' extension, also used by colour_picker. Includes tests.
2017-01-18 13:48:46 -08:00
Andrew n marshall a47bd93f4c Adding extensions for JSON support of dynamic blocks. (#834)
Adding support for extensions, functions that can assist with loading blocks, much like init functions, but that can be referenced from JSON definitions. This allows JSON definitions to define dynamic blocks such as onchange handlers and mutators.

Rewrote math_number as an example pure JSON block.
2017-01-18 12:45:39 -08:00