Add "preamble" output option

Close #335
This commit is contained in:
Mihai Bazon
2013-10-29 10:43:43 +02:00
parent 0358e376f0
commit f1b7094a57
3 changed files with 19 additions and 1 deletions

View File

@@ -61,6 +61,7 @@ function OutputStream(options) {
comments : false,
preserve_line : false,
screw_ie8 : false,
preamble : null,
}, true);
var indentation = 0;
@@ -299,6 +300,10 @@ function OutputStream(options) {
return OUTPUT;
};
if (options.preamble) {
print(options.preamble.replace(/\r\n?|[\n\u2028\u2029]|\s*$/g, "\n"));
}
var stack = [];
return {
get : get,