diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-03-01 10:23:32 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-03-01 10:56:03 +0100 |
commit | ae8b95ee9c3871f506b20c74367fdc9e8cb098e2 (patch) | |
tree | 6348ab52aad93905af66196f5d071628ac60adb5 /src/lundump.js | |
parent | 74dda64eab7951da520dc451a1f3bbb8c7d62706 (diff) | |
download | fengari-ae8b95ee9c3871f506b20c74367fdc9e8cb098e2.tar.gz fengari-ae8b95ee9c3871f506b20c74367fdc9e8cb098e2.tar.bz2 fengari-ae8b95ee9c3871f506b20c74367fdc9e8cb098e2.zip |
lua_load will load both binary and text
Diffstat (limited to 'src/lundump.js')
-rw-r--r-- | src/lundump.js | 3 |
1 files changed, 2 insertions, 1 deletions
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 '<esc>Lua'"); if (this.readByte() !== 0x53) |