From ae8b95ee9c3871f506b20c74367fdc9e8cb098e2 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Wed, 1 Mar 2017 10:23:32 +0100 Subject: lua_load will load both binary and text --- src/lundump.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lundump.js') diff --git a/src/lundump.js b/src/lundump.js index b79e6ea..5a6d8c4 100644 --- a/src/lundump.js +++ b/src/lundump.js @@ -5,6 +5,7 @@ const DataView = require('buffer-dataview'); const fs = require('fs'); const assert = require('assert'); +const lua = require('./lua.js'); const LClosure = require('./lobject.js').LClosure; const TValue = require('./lobject.js').TValue; const Proto = require('./lfunc.js').Proto; @@ -256,7 +257,7 @@ class BytecodeParser { } checkHeader() { - if (this.readString(4) !== "\x1bLua") + if (this.readString(4) !== lua.LUA_SIGNATURE) throw new Error("bad LUA_SIGNATURE, expected 'Lua'"); if (this.readByte() !== 0x53) -- cgit v1.2.3-54-g00ecf