Permalink
Browse files

Fix parseFloat mistaken uses of "radix"

Summary: It doesn't take a radix. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat

Reviewed By: yungsters

Differential Revision: D5000954

fbshipit-source-id: fe13896196f0369b1dce132cd4f30d086638740e
  • Loading branch information...
zertosh authored and facebook-github-bot committed May 4, 2017
1 parent f5056f8 commit 37f3ce1f2c538ac7483c130294f3fe5415f5fd9b
@@ -1138,12 +1138,12 @@ class AnimatedInterpolation extends AnimatedWithChildren {
return value;
}
if (/deg$/.test(value)) {
const degrees = parseFloat(value, 10) || 0;
const degrees = parseFloat(value) || 0;
const radians = degrees * Math.PI / 180.0;
return radians;
} else {
// Assume radians
return parseFloat(value, 10) || 0;
return parseFloat(value) || 0;
}
});
}
@@ -180,7 +180,7 @@ function parse1(str: string): number {
function parsePercentage(str: string): number {
// parseFloat conveniently ignores the final %
var int = parseFloat(str, 10);
var int = parseFloat(str);
if (int < 0) {
return 0;
}
@@ -111,7 +111,7 @@ function _multiplyTransform(
* Note that validation on the string is done in `_validateTransform()`.
*/
function _convertToRadians(value: string): number {
var floatValue = parseFloat(value, 10);
var floatValue = parseFloat(value);
return value.indexOf('rad') > -1 ? floatValue : floatValue * Math.PI / 180;
}
@@ -39,7 +39,7 @@ function getAssetDataFromName(filename: string, platforms: Set<string>): AssetDa
if (!(match && match[1])) {
resolution = 1;
} else {
resolution = parseFloat(match[1], 10);
resolution = parseFloat(match[1]);
if (isNaN(resolution)) {
resolution = 1;
}

0 comments on commit 37f3ce1

Please sign in to comment.