Sat, 20 Nov 2010 11:11:01 +0000
Pass sourceName to child chunks (in binary files it's only set in the top-level chunk)
lvm.js | file | annotate | diff | comparison | revisions |
--- a/lvm.js Sat Nov 20 11:07:24 2010 +0000 +++ b/lvm.js Sat Nov 20 11:11:01 2010 +0000 @@ -150,12 +150,14 @@ } }; -function LBinaryChunk(vm, chunk, start) +function LBinaryChunk(vm, chunk, start, sourceName) { this.chunk = chunk; this.pos = start||12; this.sourceName = this.readString(); + if(sourceName) + this.sourceName = sourceName; this.lineDefined = this.readInt(); this.lastLineDefined = this.readInt(); this.numUpvalues = this.readByte(); @@ -212,7 +214,7 @@ this.numPrototypes = this.readInt(); for(var i=0;i<this.numPrototypes;i++) { - var p = new LBinaryChunk(vm, chunk, this.pos); + var p = new LBinaryChunk(vm, chunk, this.pos, this.sourceName); this.pos = p.pos; this.prototypes.push(p); }