mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Fix infinity in Python, PHP, and Dart.
This commit is contained in:
@@ -32,6 +32,11 @@ goog.require('Blockly.PHP');
|
||||
Blockly.PHP['math_number'] = function(block) {
|
||||
// Numeric value.
|
||||
var code = parseFloat(block.getFieldValue('NUM'));
|
||||
if (code == Infinity) {
|
||||
code = 'INF';
|
||||
} else if (code == -Infinity) {
|
||||
code = '-INF';
|
||||
}
|
||||
return [code, Blockly.PHP.ORDER_ATOMIC];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user