Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing up a few missing semi-colons & re-declared variables.

  • Loading branch information...
commit 419ff5e50470ff0beb777fc5021756179e185817 1 parent 4a69bd2
@jperras jperras authored
Showing with 18 additions and 15 deletions.
  1. +1 −1  colors.js
  2. +6 −4 cookies.js
  3. +5 −4 shell.js
  4. +4 −4 wsrepl.js
  5. +2 −2 wsutil.js
View
2  colors.js
@@ -72,6 +72,6 @@ function stylize(str, style) {
};
return '\033[' + styles[style][0] + 'm' + str +
'\033[' + styles[style][1] + 'm';
-};
+}
exports.stylize = stylize;
View
10 cookies.js
@@ -8,11 +8,11 @@ var cookieJar = rc.cookies || {};
function endsWith(needle, hayStack) {
return hayStack.match(needle + "$") == needle;
-};
+}
function startsWith(needle, hayStack) {
return hayStack.match("^" + needle) == needle;
-};
+}
function clear() {
@@ -47,14 +47,16 @@ function get(domain, key) {
}
}
}
+ return null;
}
function parseCookie(string) {
var first = true;
var cookie = {http_only: false};
+ var parts;
string.trim().split(";").forEach(function(component) {
if (first) {
- var parts = component.trim().split('=');
+ parts = component.trim().split('=');
cookie.key = parts[0];
cookie.value = parts.slice(1).join('=');
first = false;
@@ -62,7 +64,7 @@ function parseCookie(string) {
if (component.trim().toLowerCase() === 'httponly') {
cookie.http_only = true;
} else {
- var parts = component.trim().split('=');
+ parts = component.trim().split('=');
cookie[parts[0]] = parts[1];
}
}
View
9 shell.js
@@ -34,7 +34,7 @@ _.extend(WebShell.Util, require('wsutil'));
_.mixin({
isJSON: function(headers) {
var jsonHeaders = ['application/json', 'text/x-json'];
- return headers['content-type'] && _.include(jsonHeaders, headers['content-type'].split('; ')[0])
+ return headers['content-type'] && _.include(jsonHeaders, headers['content-type'].split('; ')[0]);
}
});
@@ -105,10 +105,11 @@ WebShell.Shell = function(stream) {
this.injectLineListener(web_repl);
process.on('exit', function () {
+ var rc;
if (web_repl.rli._hardClosed) {
- var rc = wsrc.get();
+ rc = wsrc.get();
} else {
- var rc = wsrc.saveContext('_previous', $_);
+ rc = wsrc.saveContext('_previous', $_);
}
rc.history = web_repl.rli.history;
wsrc.write(rc, cookies);
@@ -337,7 +338,7 @@ WebShell.Shell = function(stream) {
jquery.setup(env.window);
}
return env.window.jQuery(selector, context);
- }
+ };
}
_.extend(result, {raw: $_.raw, headers: $_.headers, statusCode: $_.status, json: $_.json});
View
8 wsrepl.js
@@ -39,10 +39,10 @@ repl.REPLServer.prototype.complete = function (line) {
var completions,
completionGroups = [], // list of completion lists, one for each inheritance "level"
completeOn,
- match, filter, i, j, group, c;
+ match = null,
+ filter, i, j, group, c;
// REPL commands (e.g. ".break").
- var match = null;
match = line.match(/^\s*(\.\w*)$/);
if (match) {
completionGroups.push(['.break', '.clear', '.exit', '.help']);
@@ -61,7 +61,7 @@ repl.REPLServer.prototype.complete = function (line) {
completeOn = match[1];
var subdir = match[2] || "";
- var filter = match[1];
+ filter = match[1];
var dir, files, f, name, base, ext, abs, subfiles, s;
group = [];
for (i = 0; i < require.paths.length; i++) {
@@ -217,7 +217,7 @@ if (completionGroups.length && filter) {
var newCompletionGroups = [];
for (i = 0; i < completionGroups.length; i++) {
group = completionGroups[i].filter(function(elem) {
- return elem.indexOf(filter) == 0;
+ return elem.indexOf(filter) === 0;
});
if (group.length) {
newCompletionGroups.push(group);
View
4 wsutil.js
@@ -90,12 +90,12 @@ exports.httpServerError = function(status) {
exports.base64Encode = function(str) {
return (new Buffer(str, 'ascii')).toString('base64');
-}
+};
exports.printHeader = function(value, name) {
function normalizeName(name) {
return _.map(name.split('-'), function(s) { return s[0].toUpperCase() + s.slice(1, s.length); }).join('-');
- };
+ }
util.puts(normalizeName(name) + ": " + value);
};
Please sign in to comment.
Something went wrong with that request. Please try again.