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

Commit 0eb373e

Browse files
committed
fix($injector): more conservative annotation parsing
1 parent fd30718 commit 0eb373e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/auto/injector.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
4242
var FN_ARG_SPLIT = /,/;
43-
var FN_ARG = /^\s*(_?)(.+?)\1\s*$/;
43+
var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
4444
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
4545
function annotate(fn) {
4646
var $inject,

Diff for: test/auto/injectorSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ describe('injector', function() {
136136
function $f_n0 /*
137137
*/(
138138
$a, // x, <-- looks like an arg but it is a comment
139-
b_, /* z, <-- looks like an arg but it is a
139+
b_ , /* z, <-- looks like an arg but it is a
140140
multi-line comment
141141
function (a, b) {}
142142
*/

0 commit comments

Comments
 (0)