mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Fixed JS/PHP generators for math_number
It was returning ORDER_ATOMIC for the block for any number; changed it so that it now returns ORDER_UNARY_NEGATION for negative numbers.
This commit is contained in:
@@ -32,7 +32,9 @@ goog.require('Blockly.JavaScript');
|
||||
Blockly.JavaScript['math_number'] = function(block) {
|
||||
// Numeric value.
|
||||
var code = parseFloat(block.getFieldValue('NUM'));
|
||||
return [code, Blockly.JavaScript.ORDER_ATOMIC];
|
||||
var order = code >= 0 ? Blockly.JavaScript.ORDER_ATOMIC :
|
||||
Blockly.JavaScript.ORDER_UNARY_NEGATION;
|
||||
return [code, order];
|
||||
};
|
||||
|
||||
Blockly.JavaScript['math_arithmetic'] = function(block) {
|
||||
|
||||
Reference in New Issue
Block a user