From 14f5bb167951ad893760cdb526364e9edf1213ef Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 29 Jan 2018 14:59:25 +1100 Subject: src/: Export LUA_SIGNATURE as lua string instead of js string --- src/ldump.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/ldump.js') 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); -- cgit v1.2.3-54-g00ecf