Provide default mapping for boilerplate code
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user