Merge branch 'master' into harmony

This commit is contained in:
Richard van Velzen
2015-08-05 21:13:11 +02:00
5 changed files with 17 additions and 5 deletions

View File

@@ -3,8 +3,8 @@ before_install: "npm install -g npm"
node_js:
- "iojs"
- "0.12"
- "0.11"
- "0.10"
- "0.8"
matrix:
fast_finish: true
sudo: false

View File

@@ -161,6 +161,8 @@ function OutputStream(options) {
str = String(str);
var ch = str.charAt(0);
if (might_need_semicolon) {
might_need_semicolon = false;
if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) {
if (options.semicolons || requireSemicolonChars(ch)) {
OUTPUT += ";";
@@ -171,11 +173,17 @@ function OutputStream(options) {
current_pos++;
current_line++;
current_col = 0;
if (/^\s+$/.test(str)) {
// reset the semicolon flag, since we didn't print one
// now and might still have to later
might_need_semicolon = true;
}
}
if (!options.beautify)
might_need_space = false;
}
might_need_semicolon = false;
}
if (!options.beautify && options.preserve_line && stack[stack.length - 1]) {

View File

@@ -480,7 +480,11 @@ function tokenizer($TEXT, filename, html5_comments) {
regexp += ch;
}
var mods = read_name();
return token("regexp", new RegExp(regexp, mods));
try {
return token("regexp", new RegExp(regexp, mods));
} catch(e) {
parse_error(e.message);
}
});
function read_operator(prefix) {

View File

@@ -6,7 +6,7 @@
"license": "BSD",
"version": "2.4.24",
"engines": {
"node": ">=0.4.0"
"node": ">=0.8.0"
},
"maintainers": [
"Mihai Bazon <mihai.bazon@gmail.com> (http://lisperator.net/)"

View File

@@ -35,7 +35,7 @@ function tmpl() {
function log() {
var txt = tmpl.apply(this, arguments);
sys.puts(txt);
console.log("%s", txt);
}
function log_directory(dir) {