summaryrefslogtreecommitdiff
path: root/src/llex.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-12-12 13:45:10 +1100
committerdaurnimator <quae@daurnimator.com>2017-12-12 14:37:53 +1100
commitc5b39b9d292c1a2178aa41c6a95367a81614eb61 (patch)
tree26c9c9d983e70704becc1e85e1371b1be8bae371 /src/llex.js
parent8dfdad3ee84a73ec7da2312e8c8d893dd8968d17 (diff)
downloadfengari-c5b39b9d292c1a2178aa41c6a95367a81614eb61.tar.gz
fengari-c5b39b9d292c1a2178aa41c6a95367a81614eb61.tar.bz2
fengari-c5b39b9d292c1a2178aa41c6a95367a81614eb61.zip
src/: Have luaO_str2num fill in passed TValue and return length
Diffstat (limited to 'src/llex.js')
-rw-r--r--src/llex.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/llex.js b/src/llex.js
index 19f2c05..464c98e 100644
--- a/src/llex.js
+++ b/src/llex.js
@@ -236,8 +236,8 @@ const read_numeral = function(ls, seminfo) {
// save(ls, 0);
- let obj = lobject.luaO_str2num(ls.buff.buffer);
- if (obj === false) /* format error? */
+ let obj = new lobject.TValue();
+ if (lobject.luaO_str2num(ls.buff.buffer, obj) === 0) /* format error? */
lexerror(ls, defs.to_luastring("malformed number", true), R.TK_FLT);
if (obj.ttisinteger()) {
seminfo.i = obj.value;