Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

Commit

Permalink
Be safer when using getargs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelkaron committed Feb 21, 2013
1 parent 536a541 commit d4e899c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/weave.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ define([ "require", "jquery", "when", "troopjs-utils/getargs", "troopjs-utils/fi
// Store trimmed matches[0] as WEAVE on attr_args
attr_args[WEAVE] = matches[0].trim();

// Transfer arguments from getargs
ARRAY_PUSH.apply(attr_args, getargs.call(matches[2]));
// Transfer arguments from getargs (if any exist)
if (matches[2]) {
ARRAY_PUSH.apply(attr_args, getargs.call(matches[2]));
}

// Iterate end of attr_args to copy from $data
for (i = 2, iMax = attr_args[LENGTH]; i < iMax; i++) {
Expand Down

0 comments on commit d4e899c

Please # to comment.