From 1129a8f18c453f8be2765f034314bb04bb6fa66a Mon Sep 17 00:00:00 2001 From: Jakub Skowron Date: Wed, 17 Jan 2018 14:27:09 +0100 Subject: [PATCH] [Utils] Fix Long conversion (allow hex string value) Until now string "0x15" would be converted 0. This change affects all numeric conversions which use _toLong. According to https://www.w3.org/TR/WebIDL-1/#es-long value should be initialized by ToNumber, which is defined in https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type and allows value to be in form of HexIntegerLiteral. Change-Id: Ib719ce8fd5beccc5947b761dc905c49ac0469490 --- src/utils/utils_api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/utils_api.js b/src/utils/utils_api.js index 51e9104..4cc9868 100644 --- a/src/utils/utils_api.js +++ b/src/utils/utils_api.js @@ -386,7 +386,7 @@ Converter.prototype.toBoolean = function(val, nullable) { }; function _toLong(val) { - var ret = parseInt(val, 10); + var ret = parseInt(val); return isNaN(ret) ? (val === true ? 1 : 0) : ret; } -- 2.7.4