Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix($injector): more conservative annotation parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed Sep 6, 2012
1 parent 8cb9c99 commit d9eff86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/auto/injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
var FN_ARG = /^\s*(_?)(.+?)\1\s*$/;
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
function annotate(fn) {
var $inject,
Expand Down
2 changes: 1 addition & 1 deletion test/auto/injectorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe('injector', function() {
function $f_n0 /*
*/(
$a, // x, <-- looks like an arg but it is a comment
b_, /* z, <-- looks like an arg but it is a
b_ , /* z, <-- looks like an arg but it is a
multi-line comment
function (a, b) {}
*/
Expand Down

0 comments on commit d9eff86

Please sign in to comment.