Skip to content

Commit c24b07c

Browse files
committed
fix event blockly INDENT
1 parent 8774e0f commit c24b07c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/assets/js/blockly/blocks.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,10 +1127,10 @@ Blockly.Blocks.coderbot_event_generator = {
11271127

11281128
let coderbot_generator_id = 1;
11291129
Blockly.Python.coderbot_event_generator = function (block) {
1130-
const INDENT_saved = Blockly.Generator.prototype.INDENT;
1131-
Blockly.Generator.prototype.INDENT = Blockly.Generator.prototype.INDENT + Blockly.Generator.prototype.INDENT;
1130+
const INDENT_saved = Blockly.Generator.INDENT;
1131+
Blockly.Generator.INDENT = Blockly.Generator.INDENT + Blockly.Generator.INDENT;
11321132
const statements_event_generator = Blockly.Python.statementToCode(block, 'generator_statements');
1133-
Blockly.Generator.prototype.INDENT = INDENT_saved;
1133+
Blockly.Generator.INDENT = INDENT_saved;
11341134
const code = `def event_generator_${coderbot_generator_id}():\n${
11351135
INDENT_saved}while True:\n${
11361136
INDENT_saved}${INDENT_saved}get_prog_eng().check_end()\n${
@@ -1160,7 +1160,7 @@ Blockly.Python.coderbot_event_listener = function (block) {
11601160
const event_topic = block.getFieldValue('event_topic');
11611161
const event_statements = Blockly.Python.statementToCode(block, 'event_statements');
11621162
const code = `def event_listener_${coderbot_listener_id}(message):\n${
1163-
Blockly.Generator.prototype.INDENT}event_data = json.loads(message)\n${
1163+
Blockly.Generator.INDENT}event_data = json.loads(message)\n${
11641164
event_statements}\n` +
11651165
`get_event().register_event_listener('${event_topic}', event_listener_${coderbot_listener_id})`;
11661166
coderbot_listener_id++;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy