# HG changeset patch # User Matthew Wild # Date 1270604816 -3600 # Node ID f259da6951e856d93bc926f6ed072c39b457eeee # Parent 7d748aba47abe4da972b1c0e035a6d4aa0ab57a9 Support for reading all fields in the chunk (including function prototypes, required for OP_CLOSURE) diff -r 7d748aba47ab -r f259da6951e8 lvm.js --- a/lvm.js Tue Apr 06 19:27:28 2010 +0100 +++ b/lvm.js Wed Apr 07 02:46:56 2010 +0100 @@ -56,10 +56,10 @@ return new LValue("function", func); } -function LBinaryChunk(chunk) +function LBinaryChunk(chunk, start) { this.chunk = chunk; - this.pos = 12; + this.pos = start||12; this.sourceName = this.readString(); this.lineDefined = this.readInt(); @@ -113,6 +113,38 @@ } } + this.prototypes = []; + + this.numPrototypes = this.readInt(); + for(var i=0;i