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.
This commit is contained in:
Igor Minar 2010-11-15 22:44:05 -08:00
parent b2d63ac48b
commit beeb5ff908

View file

@ -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],