Skip to content

Commit

Permalink
Add verbatim option
Browse files Browse the repository at this point in the history
  • Loading branch information
Constellation committed Oct 20, 2012
1 parent f9ccd7b commit 582483f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion escodegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@
},
sourceMap: null,
sourceMapWithCode: false,
directive: false
directive: false,
verbatim: null
};
}

Expand Down Expand Up @@ -762,6 +763,10 @@
return [result, newline, base];
}

function generateVerbatim(expr) {
return expr[extra.verbatim];
}

function generateFunctionBody(node) {
var result, i, len, expr;
result = ['('];
Expand Down Expand Up @@ -797,6 +802,10 @@
allowIn = option.allowIn;
allowCall = option.allowCall;

if (extra.verbatim && expr.hasOwnProperty(extra.verbatim)) {
return generateVerbatim(expr);
}

switch (expr.type) {
case Syntax.SequenceExpression:
result = [];
Expand Down

0 comments on commit 582483f

Please sign in to comment.