Version 1
[yaffs-website] / node_modules / core-js / library / modules / _parse-int.js
diff --git a/node_modules/core-js/library/modules/_parse-int.js b/node_modules/core-js/library/modules/_parse-int.js
new file mode 100644 (file)
index 0000000..c23ffc0
--- /dev/null
@@ -0,0 +1,9 @@
+var $parseInt = require('./_global').parseInt
+  , $trim     = require('./_string-trim').trim
+  , ws        = require('./_string-ws')
+  , hex       = /^[\-+]?0[xX]/;
+
+module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix){
+  var string = $trim(String(str), 3);
+  return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
+} : $parseInt;
\ No newline at end of file