diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-03-17 09:45:49 +0100 |
---|---|---|
committer | Benoit Giannangeli <giann@users.noreply.github.com> | 2017-03-17 10:36:57 +0100 |
commit | 18631188532881934261e72321d9839ad42d1b06 (patch) | |
tree | a426425e76be16eee6eb4fafec411f147bb4d472 /src/lstrlib.js | |
parent | 0cbdb3527041d016097aa3384af9c5908af2cce6 (diff) | |
download | fengari-18631188532881934261e72321d9839ad42d1b06.tar.gz fengari-18631188532881934261e72321d9839ad42d1b06.tar.bz2 fengari-18631188532881934261e72321d9839ad42d1b06.zip |
lua_todataview to use string as binary representation
Diffstat (limited to 'src/lstrlib.js')
-rw-r--r-- | src/lstrlib.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lstrlib.js b/src/lstrlib.js index 83e82b0..02feff6 100644 --- a/src/lstrlib.js +++ b/src/lstrlib.js @@ -3,9 +3,10 @@ const assert = require('assert'); const sprintf = require('sprintf'); -const lua = require('./lua.js'); const lapi = require('./lapi.js'); const lauxlib = require('./lauxlib.js'); +const lobject = require('./lobject.js'); +const lua = require('./lua.js'); const luaconf = require('./luaconf.js'); const CT = lua.constant_types; @@ -61,7 +62,7 @@ const str_dump = function(L) { lapi.lua_settop(L, 1); if (lapi.lua_dump(L, writer, b, strip) !== 0) return lauxlib.luaL_error(L, "unable to dump given function"); - lapi.lua_pushrawstring(L, b.map(e => String.fromCharCode(e)).join('')); + L.stack[L.top++] = new lobject.TValue(CT.LUA_TLNGSTR, b); // We don't want lua > js > lua string conversion here return 1; }; |