decorator.js 300 B

12345678910
  1. 'use strict';
  2. goog.provide('Blockly.Python.decorator');
  3. goog.require('Blockly.Python');
  4. Blockly.Python['decorator'] = function(block) {
  5. var value_name = Blockly.Python.valueToCode(block, 'BODY', Blockly.Python.ORDER_ATOMIC);
  6. var code = '@'+(value_name || '___')+'\n';
  7. return code;
  8. };