diff options
| author | Misko Hevery | 2012-09-05 14:46:17 -0700 |
|---|---|---|
| committer | Misko Hevery | 2012-09-06 16:06:24 -0700 |
| commit | d9eff86ef77dd76208cef21e882239d4db0eac1e (patch) | |
| tree | 1afa753eb1d6856b53703c10ed242921cea7da7f | |
| parent | 8cb9c99ec064fd95567118d29bfa4a19b8613ab3 (diff) | |
| download | angular.js-d9eff86ef77dd76208cef21e882239d4db0eac1e.tar.bz2 | |
fix($injector): more conservative annotation parsing
| -rw-r--r-- | src/auto/injector.js | 2 | ||||
| -rw-r--r-- | test/auto/injectorSpec.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/auto/injector.js b/src/auto/injector.js index a7c39731..a1d80ddb 100644 --- a/src/auto/injector.js +++ b/src/auto/injector.js @@ -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, diff --git a/test/auto/injectorSpec.js b/test/auto/injectorSpec.js index eee8c944..d2a63789 100644 --- a/test/auto/injectorSpec.js +++ b/test/auto/injectorSpec.js @@ -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) {} */ |
