lvm.js

changeset 92
e9da9847121a
parent 91
298efa276aff
child 93
748b51e8f0d6
equal deleted inserted replaced
91:298efa276aff 92:e9da9847121a
148 } 148 }
149 return false; 149 return false;
150 } 150 }
151 }; 151 };
152 152
153 function LBinaryChunk(vm, chunk, start) 153 function LBinaryChunk(vm, chunk, start, sourceName)
154 { 154 {
155 this.chunk = chunk; 155 this.chunk = chunk;
156 this.pos = start||12; 156 this.pos = start||12;
157 157
158 this.sourceName = this.readString(); 158 this.sourceName = this.readString();
159 if(sourceName)
160 this.sourceName = sourceName;
159 this.lineDefined = this.readInt(); 161 this.lineDefined = this.readInt();
160 this.lastLineDefined = this.readInt(); 162 this.lastLineDefined = this.readInt();
161 this.numUpvalues = this.readByte(); 163 this.numUpvalues = this.readByte();
162 this.numParameters = this.readByte(); 164 this.numParameters = this.readByte();
163 this.isVararg = this.readByte(); 165 this.isVararg = this.readByte();
210 this.prototypes = []; 212 this.prototypes = [];
211 213
212 this.numPrototypes = this.readInt(); 214 this.numPrototypes = this.readInt();
213 for(var i=0;i<this.numPrototypes;i++) 215 for(var i=0;i<this.numPrototypes;i++)
214 { 216 {
215 var p = new LBinaryChunk(vm, chunk, this.pos); 217 var p = new LBinaryChunk(vm, chunk, this.pos, this.sourceName);
216 this.pos = p.pos; 218 this.pos = p.pos;
217 this.prototypes.push(p); 219 this.prototypes.push(p);
218 } 220 }
219 221
220 this.sourceLines = []; 222 this.sourceLines = [];

mercurial