mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-01 12:33:37 +08:00
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:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user