This change means the list is complete for every environment. This makes evaling code more safe. However it also means that code generated on one environment isn't guaranteed to be free of global collisions when executed on another environment (with the exception of the JS Interpreter).
So if you are generating code in Node, and then executing it with eval() in a user's browser a user's program could declare a variable named `location`, assign to it, and the browser will redirect to that URL. Honestly, that's what you get for evaling untrusted code between users. Use the JS Interpreter if you are doing anything other than just generating and executing in the same environment.
* 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.
* Moved comment icons to use a model-based system. The block holds the model of the comment, and the comment icon holds a reference to it.
* Reorganized the setVisible function.
* Changed how xml.js serializes and deserializes comments.
Number() is a bit less forgiving than parseFloat() and is more likely to generate NaN rather than some random number. An audit of each case shows nowhere that parseFloat()’s features are needed.
Previously a function call with no return value generated:
prefix();
suffix();
function();
The intent was so the prefix and suffix calls in the function body wouldn’t overlap with the prefix and suffix calls of the function call. However, this is doomed to be inconsistent with a function call with a return value:
prefix();
print(function());
suffix();
Thus since overlaping must exist, both types of function calls should have consistent suffix locations.
Visit (with prefix and suffix) function block when executed. This commit adds a revisit at the end of the function body when evaluating the return value.
This allows generators to have more control over the placement of suffix. Needed for ‘if’ blocks and function calls which require their suffix code to be somewhere other than the end.
Also, add loop’s prefix to ‘break’ blocks, since the loop’s suffix will be the next statement hit.
Also, reuse procedures_callreturn generator for procedures_callnoreturn.
Also remove need to manually indent INFINITE_LOOP_TRAP. This is a breaking change for Python users of this property. However, very few users of this property exist, given that the existing code breaks if the block ID has a $ in it (also fixed in this PR).