aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--src/library.js9
2 files changed, 8 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index f7a2225a..5c5baee0 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -79,5 +79,6 @@ a license to everyone to use it as detailed in LICENSE.)
* Dan Gohman <sunfish@google.com> (copyright owned by Google, Inc.)
* Jeff Gilbert <jgilbert@mozilla.com> (copyright owned by Mozilla Foundation)
* Frits Talbot <frits@metapathy.com>
+* Onno Jongbloed <hey@onnoj.net>
diff --git a/src/library.js b/src/library.js
index ef8afaef..07368ee7 100644
--- a/src/library.js
+++ b/src/library.js
@@ -2617,7 +2617,8 @@ LibraryManager.library = {
var curr = 0;
var buffer = [];
// Read characters according to the format. floats are trickier, they may be in an unfloat state in the middle, then be a valid float later
- if (type == 'f' || type == 'e' || type == 'g' || type == 'E') {
+ if (type == 'f' || type == 'e' || type == 'g' ||
+ type == 'F' || type == 'E' || type == 'G') {
var last = 0;
next = get();
while (next > 0) {
@@ -2639,7 +2640,7 @@ LibraryManager.library = {
(type == 's' ||
((type === 'd' || type == 'u' || type == 'i') && ((next >= {{{ charCode('0') }}} && next <= {{{ charCode('9') }}}) ||
(first && next == {{{ charCode('-') }}}))) ||
- (type === 'x' && (next >= {{{ charCode('0') }}} && next <= {{{ charCode('9') }}} ||
+ ((type === 'x' || type === 'X') && (next >= {{{ charCode('0') }}} && next <= {{{ charCode('9') }}} ||
next >= {{{ charCode('a') }}} && next <= {{{ charCode('f') }}} ||
next >= {{{ charCode('A') }}} && next <= {{{ charCode('F') }}}))) &&
(formatIndex >= format.length || next !== format[formatIndex].charCodeAt(0))) { // Stop when we read something that is coming up
@@ -2669,11 +2670,15 @@ LibraryManager.library = {
{{{ makeSetValue('argPtr', 0, 'parseInt(text, 10)', 'i32') }}};
}
break;
+ case 'X':
case 'x':
{{{ makeSetValue('argPtr', 0, 'parseInt(text, 16)', 'i32') }}}
break;
+ case 'F':
case 'f':
+ case 'E':
case 'e':
+ case 'G':
case 'g':
case 'E':
// fallthrough intended