From beeb5ff908b2f30465263fb36c58ddb217dc2a0c Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 15 Nov 2010 22:44:05 -0800 Subject: fix regexp for @param parsing in ng:docs There is an extra + in the regexp which causes exponential increase in time needed to parse a @param annotation when the length of default value increases linearly. --- docs/collect.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/collect.js b/docs/collect.js index 7ad1630b..80053d34 100644 --- a/docs/collect.js +++ b/docs/collect.js @@ -229,7 +229,8 @@ var TAG = { param: function(doc, name, value){ doc.param = doc.param || []; doc.paramRest = doc.paramRest || []; - var match = value.match(/^({([^\s=]+)(=)?}\s*)?(([^\s=]+)|\[(\S+)+=([^\]]+)\])\s+(.*)/); + var match = value.match(/^({([^\s=]+)(=)?}\s*)?(([^\s=]+)|\[(\S+)=([^\]]+)\])\s+(.*)/); + // 1 2 23 3 1 45 5 6 6 7 7 4 8 8 if (match) { var param = { type: match[2], -- cgit v1.2.3