12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- 'use strict';
- goog.provide('Blockly.Dart.variables');
- goog.require('Blockly.Dart');
- Blockly.Dart['variables_get'] = function(block) {
-
- var code = Blockly.Dart.variableDB_.getName(block.getFieldValue('VAR'),
- Blockly.Variables.NAME_TYPE);
- return [code, Blockly.Dart.ORDER_ATOMIC];
- };
- Blockly.Dart['variables_set'] = function(block) {
-
- var argument0 = Blockly.Dart.valueToCode(block, 'VALUE',
- Blockly.Dart.ORDER_ASSIGNMENT) || '0';
- var varName = Blockly.Dart.variableDB_.getName(block.getFieldValue('VAR'),
- Blockly.Variables.NAME_TYPE);
- return varName + ' = ' + argument0 + ';\n';
- };
|