mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
Change parseFloat() to Number()
Number() is a bit less forgiving than parseFloat() and is more likely to generate NaN rather than some random number. An audit of each case shows nowhere that parseFloat()’s features are needed.
This commit is contained in:
@@ -285,7 +285,7 @@ Blockly.PHP.getAdjusted = function(block, atId, opt_delta, opt_negate,
|
||||
|
||||
if (Blockly.isNumber(at)) {
|
||||
// If the index is a naked number, adjust it right now.
|
||||
at = parseFloat(at) + delta;
|
||||
at = Number(at) + delta;
|
||||
if (opt_negate) {
|
||||
at = -at;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user