mirror of
https://github.com/google/blockly.git
synced 2026-01-10 10:27:08 +01:00
Use a comment block for function comments in generated JS, Python and Dart.
This commit is contained in:
@@ -193,7 +193,14 @@ Blockly.JavaScript.scrub_ = function(block, code) {
|
||||
// Collect comment for this block.
|
||||
var comment = block.getCommentText();
|
||||
if (comment) {
|
||||
commentCode += Blockly.JavaScript.prefixLines(comment, '// ') + '\n';
|
||||
if (block.getProcedureDef) {
|
||||
// Use a comment block for function comments.
|
||||
commentCode += '/**\n' +
|
||||
Blockly.JavaScript.prefixLines(comment + '\n', ' * ') +
|
||||
' */\n';
|
||||
} else {
|
||||
commentCode += Blockly.JavaScript.prefixLines(comment + '\n', '// ');
|
||||
}
|
||||
}
|
||||
// Collect comments for all value arguments.
|
||||
// Don't collect comments for nested statements.
|
||||
|
||||
Reference in New Issue
Block a user