mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-13 17:02:23 +08:00
fix($injector): more conservative annotation parsing
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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) {}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user