aboutsummaryrefslogtreecommitdiff
path: root/src/ldump.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-01-29 14:59:25 +1100
committerdaurnimator <quae@daurnimator.com>2018-01-29 22:04:32 +1100
commit14f5bb167951ad893760cdb526364e9edf1213ef (patch)
treecabfa9ce9f75479e036428b22a0e78ef9d48598c /src/ldump.js
parent9aaddb7c9814d97502adb0e115c613598923b8d5 (diff)
downloadfengari-14f5bb167951ad893760cdb526364e9edf1213ef.tar.gz
fengari-14f5bb167951ad893760cdb526364e9edf1213ef.tar.bz2
fengari-14f5bb167951ad893760cdb526364e9edf1213ef.zip
src/: Export LUA_SIGNATURE as lua string instead of js string
Diffstat (limited to 'src/ldump.js')
-rw-r--r--src/ldump.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/ldump.js b/src/ldump.js
index 09e5866..596a319 100644
--- a/src/ldump.js
+++ b/src/ldump.js
@@ -12,8 +12,7 @@ const {
LUA_TNUMINT,
LUA_TSHRSTR
},
- luastring_of,
- to_luastring
+ luastring_of
} = require('./defs.js');
const LUAC_DATA = luastring_of(25, 147, 13, 10, 26, 10);
@@ -37,11 +36,6 @@ const DumpBlock = function(b, size, D) {
D.status = D.writer(D.L, b, size, D.data);
};
-const DumpLiteral = function(s, D) {
- s = to_luastring(s);
- DumpBlock(s, s.length, D);
-};
-
const DumpByte = function(y, D) {
DumpBlock(luastring_of(y), 1, D);
};
@@ -172,7 +166,7 @@ const DumpFunction = function(f, psource, D) {
};
const DumpHeader = function(D) {
- DumpLiteral(LUA_SIGNATURE, D);
+ DumpBlock(LUA_SIGNATURE, LUA_SIGNATURE.length, D);
DumpByte(LUAC_VERSION, D);
DumpByte(LUAC_FORMAT, D);
DumpBlock(LUAC_DATA, LUAC_DATA.length, D);