Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #85 from arthuraa/fix-int-of-string

Fix int of string
  • Loading branch information...
commit 953f9d129b298eac94fe1b06c406553ca23dafbd 2 parents 4473302 + 1e3446e
@BourgerieQuentin BourgerieQuentin authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/plugins/opabsl/nodejsbsl/bslNumber.nodejs
View
9 lib/plugins/opabsl/nodejsbsl/bslNumber.nodejs
@@ -40,7 +40,7 @@ function qNaNarray(le) { return (le) ? qNaNarray_le : qNaNarray_be; }
/** @module Int */
// Note: for bitwise ops you only get 32 bits - and they're sign extended
-/** @register { int} max_int max_int */
+/** @register {int} max_int max_int */
var max_int = Math.pow(2, 53);
/**
@@ -73,7 +73,12 @@ function int_of_string(str) {
*/
function int_of_string_opt(str) {
try {
- js_some(BslNumber_Int_of_string(str));
+ var res = int_of_string(str);
+ if (isNaN(res)) {
+ return js_none;
+ } else {
+ return js_some(res);
+ }
} catch(e) {
return js_none;
}
Please sign in to comment.
Something went wrong with that request. Please try again.