diff options
| author | Misko Hevery | 2012-09-05 14:46:17 -0700 |
|---|---|---|
| committer | Misko Hevery | 2012-09-06 15:49:50 -0700 |
| commit | 0eb373e0e65283d030a98e14138e86c31c653001 (patch) | |
| tree | 6f08476bf7128a251d5b824f7901ff7d5ef74eed | |
| parent | fd3071843ca53a34a084f5d495f9f0aea82f2ef5 (diff) | |
| download | angular.js-0eb373e0e65283d030a98e14138e86c31c653001.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 e07c03a7..eb4cc45b 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 33fecac6..7e5c5d33 100644 --- a/test/auto/injectorSpec.js +++ b/test/auto/injectorSpec.js @@ -136,7 +136,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) {} */ |
