aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/output.js35
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/output.js b/lib/output.js
index c2f49e9e..55039030 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -46,22 +46,23 @@
function OutputStream(options) {
options = defaults(options, {
- indent_start : 0,
- indent_level : 4,
- quote_keys : false,
- space_colon : true,
- ascii_only : false,
- inline_script : false,
- width : 80,
- max_line_len : 32000,
- beautify : false,
- source_map : null,
- bracketize : false,
- semicolons : true,
- comments : false,
- preserve_line : false,
- screw_ie8 : false,
- preamble : null,
+ indent_start : 0,
+ indent_level : 4,
+ quote_keys : false,
+ space_colon : true,
+ ascii_only : false,
+ unescape_regexps : false,
+ inline_script : false,
+ width : 80,
+ max_line_len : 32000,
+ beautify : false,
+ source_map : null,
+ bracketize : false,
+ semicolons : true,
+ comments : false,
+ preserve_line : false,
+ screw_ie8 : false,
+ preamble : null,
}, true);
var indentation = 0;
@@ -1150,7 +1151,7 @@ function OutputStream(options) {
var str = self.getValue().toString();
if (output.option("ascii_only")) {
str = output.to_ascii(str);
- } else {
+ } else if (output.option("unescape_regexps")) {
str = str.split("\\\\").map(function(str){
return str.replace(/\\u[0-9a-fA-F]{4}|\\x[0-9a-fA-F]{2}/g, function(s){
var code = parseInt(s.substr(2), 16);