Skip to content

Commit

Permalink
avoid using arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Jan 24, 2017
1 parent 044f9dd commit 04d8ad1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
10 changes: 5 additions & 5 deletions background/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ var Settings = {
this.set("searchEngineRules", rules);
},
searchUrl: function(str) {
var map, obj, ind;
var map, obj, ind, str2;
if (str) {
Utils.parseSearchEngines("~:" + str, map = this.cache.searchEngineMap);
obj = map["~"];
str = obj.url.replace(Utils.spacesRe, "%20");
if (obj.name) { str += " " + obj.name; }
if (str !== arguments[0]) {
this.set("searchUrl", str);
str2 = obj.url.replace(Utils.spacesRe, "%20");
if (obj.name) { str2 += " " + obj.name; }
if (str2 !== str) {
this.set("searchUrl", str2);
return;
}
} else if (str = this.get("newTabUrl_f", true)) {
Expand Down
7 changes: 3 additions & 4 deletions background/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ var Utils = {
: 0;
},
_fileExtRe: /\.\w+$/,
formatVimiumUrl: function(path, partly, vimiumUrlWork) {
var ind, query, tempStr;
path = path.trim();
formatVimiumUrl: function(fullpath, partly, vimiumUrlWork) {
var ind, query, tempStr, path = fullpath.trim();
if (!path) { return partly ? "" : location.origin + "/pages/"; }
ind = path.indexOf(" ");
if (ind > 0) {
Expand All @@ -223,7 +222,7 @@ var Utils = {
} else if (Settings.CONST.KnownPages.indexOf(path) >= 0 || path.charCodeAt(0) === 47) {
path += ".html";
} else if (vimiumUrlWork === 1 || vimiumUrlWork === -1) {
return "vimium://" + arguments[0].trim();
return "vimium://" + fullpath.trim();
} else {
path = "show.html#!url vimium://" + path;
}
Expand Down
4 changes: 2 additions & 2 deletions content/scroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Core: {
}
};

VScroller.Core.animate = function () {
VScroller.Core.animate = function (a, d, e) {
var amount = 0, calibration = 1.0, di = 0, duration = 0, element = null, //
sign = 0, timestamp = -1.0, totalDelta = 0.0, totalElapsed = 0.0, //
animate = function(newTimestamp) {
Expand Down Expand Up @@ -193,5 +193,5 @@ VScroller.Core.animate = function () {
VScroller.keyIsDown = this.maxInterval;
requestAnimationFrame(animate);
};
this.animate.apply(this, arguments);
return this.animate(a, d, e);
};

0 comments on commit 04d8ad1

Please sign in to comment.