Provide default mapping for boilerplate code

This commit is contained in:
kpdecker
2014-11-08 17:04:12 -06:00
parent 0dbeeb4503
commit 1429587dd4
@@ -88,6 +88,7 @@ JavaScriptCompiler.prototype = {
var opcodes = environment.opcodes,
opcode,
firstLoc,
i,
l;
@@ -95,11 +96,12 @@ JavaScriptCompiler.prototype = {
opcode = opcodes[i];
this.source.currentLocation = opcode.loc;
firstLoc = firstLoc || opcode.loc;
this[opcode.opcode].apply(this, opcode.args);
}
// Flush any trailing content that might be pending.
this.source.currentLocation = undefined;
this.source.currentLocation = firstLoc;
this.pushSource('');
/* istanbul ignore next */
@@ -135,6 +137,8 @@ JavaScriptCompiler.prototype = {
if (!asObject) {
ret.compiler = JSON.stringify(ret.compiler);
this.source.currentLocation = {firstLine: 1, firstColumn: 0};
ret = this.objectLiteral(ret);
if (options.srcName) {