refactor(generators): Migrate generators/javascript.js to goog.module

Also migrate generators/javascript/*.js.
This commit is contained in:
Christopher Allen
2021-11-16 23:56:57 +00:00
parent 335ff199d7
commit b7d4117ca7
11 changed files with 79 additions and 78 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
*/
'use strict';
goog.provide('Blockly.JavaScript.colour');
goog.module('Blockly.JavaScript.colour');
goog.require('Blockly.JavaScript');
+2 -4
View File
@@ -9,7 +9,7 @@
*/
'use strict';
goog.provide('Blockly.JavaScript.lists');
goog.module('Blockly.JavaScript.lists');
goog.require('Blockly.JavaScript');
@@ -247,9 +247,8 @@ Blockly.JavaScript['lists_setIndex'] = function(block) {
* @param {string} where The method of indexing, selected by dropdown in Blockly
* @param {string=} opt_at The optional offset when indexing from start/end.
* @return {string|undefined} Index expression.
* @private
*/
Blockly.JavaScript.lists.getIndex_ = function(listName, where, opt_at) {
const getIndex_ = function(listName, where, opt_at) {
if (where === 'FIRST') {
return '0';
} else if (where === 'FROM_END') {
@@ -310,7 +309,6 @@ Blockly.JavaScript['lists_getSublist'] = function(block) {
} else {
const at1 = Blockly.JavaScript.getAdjusted(block, 'AT1');
const at2 = Blockly.JavaScript.getAdjusted(block, 'AT2');
const getIndex_ = Blockly.JavaScript.lists.getIndex_;
const wherePascalCase = {'FIRST': 'First', 'LAST': 'Last',
'FROM_START': 'FromStart', 'FROM_END': 'FromEnd'};
const functionName = Blockly.JavaScript.provideFunction_(
+1 -1
View File
@@ -9,7 +9,7 @@
*/
'use strict';
goog.provide('Blockly.JavaScript.logic');
goog.module('Blockly.JavaScript.logic');
goog.require('Blockly.JavaScript');
+1 -1
View File
@@ -9,7 +9,7 @@
*/
'use strict';
goog.provide('Blockly.JavaScript.loops');
goog.module('Blockly.JavaScript.loops');
goog.require('Blockly.JavaScript');
+1 -1
View File
@@ -9,7 +9,7 @@
*/
'use strict';
goog.provide('Blockly.JavaScript.math');
goog.module('Blockly.JavaScript.math');
goog.require('Blockly.JavaScript');
+1 -1
View File
@@ -9,7 +9,7 @@
*/
'use strict';
goog.provide('Blockly.JavaScript.procedures');
goog.module('Blockly.JavaScript.procedures');
goog.require('Blockly.JavaScript');
+1 -1
View File
@@ -9,7 +9,7 @@
*/
'use strict';
goog.provide('Blockly.JavaScript.texts');
goog.module('Blockly.JavaScript.texts');
goog.require('Blockly.JavaScript');
+1 -1
View File
@@ -9,7 +9,7 @@
*/
'use strict';
goog.provide('Blockly.JavaScript.variables');
goog.module('Blockly.JavaScript.variables');
goog.require('Blockly.JavaScript');
+1 -1
View File
@@ -9,7 +9,7 @@
*/
'use strict';
goog.provide('Blockly.JavaScript.variablesDynamic');
goog.module('Blockly.JavaScript.variablesDynamic');
goog.require('Blockly.JavaScript');
goog.require('Blockly.JavaScript.variables');