summaryrefslogtreecommitdiff
path: root/src/lapi.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/lapi.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/lapi.js')
-rw-r--r--src/lapi.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lapi.js b/src/lapi.js
index c1952dd..3726af0 100644
--- a/src/lapi.js
+++ b/src/lapi.js
@@ -812,14 +812,14 @@ const lua_compare = function(L, index1, index2, op) {
};
const lua_stringtonumber = function(L, s) {
- let tv = lobject.luaO_str2num(s);
- if (tv) {
+ let tv = new TValue();
+ let sz = lobject.luaO_str2num(s, tv);
+ if (sz !== 0) {
L.stack[L.top] = tv;
L.top++;
assert(L.top <= L.ci.top, "stack overflow");
- return s.length+1;
}
- return 0;
+ return sz;
};
const f_call = function(L, ud) {