mirror of
https://github.com/google/blockly.git
synced 2026-05-12 23:20:10 +02:00
refactor(generators): Migrate generators/javascript.js to goog.module
Also migrate generators/javascript/*.js.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.JavaScript.colour');
|
||||
goog.module('Blockly.JavaScript.colour');
|
||||
|
||||
goog.require('Blockly.JavaScript');
|
||||
|
||||
|
||||
@@ -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_(
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.JavaScript.logic');
|
||||
goog.module('Blockly.JavaScript.logic');
|
||||
|
||||
goog.require('Blockly.JavaScript');
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.JavaScript.loops');
|
||||
goog.module('Blockly.JavaScript.loops');
|
||||
|
||||
goog.require('Blockly.JavaScript');
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.JavaScript.math');
|
||||
goog.module('Blockly.JavaScript.math');
|
||||
|
||||
goog.require('Blockly.JavaScript');
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.JavaScript.procedures');
|
||||
goog.module('Blockly.JavaScript.procedures');
|
||||
|
||||
goog.require('Blockly.JavaScript');
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.JavaScript.texts');
|
||||
goog.module('Blockly.JavaScript.texts');
|
||||
|
||||
goog.require('Blockly.JavaScript');
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.JavaScript.variables');
|
||||
goog.module('Blockly.JavaScript.variables');
|
||||
|
||||
goog.require('Blockly.JavaScript');
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user