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: node_js:
- "iojs" - "iojs"
- "0.12" - "0.12"
- "0.11"
- "0.10" - "0.10"
- "0.8"
matrix: matrix:
fast_finish: true fast_finish: true
sudo: false sudo: false

View File

@@ -161,6 +161,8 @@ function OutputStream(options) {
str = String(str); str = String(str);
var ch = str.charAt(0); var ch = str.charAt(0);
if (might_need_semicolon) { if (might_need_semicolon) {
might_need_semicolon = false;
if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) { if ((!ch || ";}".indexOf(ch) < 0) && !/[;]$/.test(last)) {
if (options.semicolons || requireSemicolonChars(ch)) { if (options.semicolons || requireSemicolonChars(ch)) {
OUTPUT += ";"; OUTPUT += ";";
@@ -171,11 +173,17 @@ function OutputStream(options) {
current_pos++; current_pos++;
current_line++; current_line++;
current_col = 0; 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) if (!options.beautify)
might_need_space = false; might_need_space = false;
} }
might_need_semicolon = false;
} }
if (!options.beautify && options.preserve_line && stack[stack.length - 1]) { if (!options.beautify && options.preserve_line && stack[stack.length - 1]) {

View File

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

View File

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

View File

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