Skip to content

Commit

Permalink
Consolidated destination flag variable [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
bemson committed Feb 26, 2014
1 parent ae51e25 commit 2b7764c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/salt.js
Expand Up @@ -30,6 +30,7 @@
return obj instanceof Array; return obj instanceof Array;
}, },
tokenPrefix = '@', tokenPrefix = '@',
queryDestinationFlag = '>',
defaultPermissions = {world: true, owner: true, sub: true, self: true}, defaultPermissions = {world: true, owner: true, sub: true, self: true},
redirectFlag = 1, redirectFlag = 1,
// regexps // regexps
Expand Down Expand Up @@ -377,7 +378,7 @@
; ;
if (exists && (typeofTagValue = typeof (tagValue = tags[tagName])) !== 'function') { if (exists && (typeofTagValue = typeof (tagValue = tags[tagName])) !== 'function') {
if (typeofTagValue === 'string' && tagValue.length) { if (typeofTagValue === 'string' && tagValue.length) {
if (tagValue.charAt(0) === '>') { if (tagValue.charAt(0) === queryDestinationFlag) {
useTarget = 1; useTarget = 1;
} }
tgtIdx = pkg.indexOf(tagValue, node); tgtIdx = pkg.indexOf(tagValue, node);
Expand Down Expand Up @@ -444,7 +445,7 @@
node.nxtc = 0; node.nxtc = 0;


if (exists) { if (exists) {
if (typeof (tagValue = tags[tagName]) === 'string' && tagValue.charAt(0) === '>') { if (typeof (tagValue = tags[tagName]) === 'string' && tagValue.charAt(0) === queryDestinationFlag) {
// flag that this will clear existing waypoints // flag that this will clear existing waypoints
node.nxtc = 1; node.nxtc = 1;
} }
Expand Down Expand Up @@ -1965,7 +1966,7 @@
case 'string': case 'string':


// remove redirect flag // remove redirect flag
if (qry.charAt(0) === '>') { if (qry.charAt(0) === queryDestinationFlag) {
qry = qry.substr(1); qry = qry.substr(1);
} }


Expand Down

0 comments on commit 2b7764c

Please sign in to comment.