From a151eb5425f67afb2407c5e7795c751789f0297e Mon Sep 17 00:00:00 2001 From: M Alix Date: Fri, 11 Apr 2014 16:09:28 -0400 Subject: [PATCH] Minor change puts \- at end of character pattern In CLASS_DIRECTIVE_REGEXP and COMMENT_DIRECTIVE_REGEXP, putting the \- character at the end of the character patter speeds up many IDE parsers and alleviates some errors in certain IDE's. (WebStorm 8) Functionally absolutely equivalent. No test change needed. --- src/ng/compile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ng/compile.js b/src/ng/compile.js index ed56d2b2c11a..8f434d3117db 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -512,8 +512,8 @@ $CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider']; function $CompileProvider($provide, $$sanitizeUriProvider) { var hasDirectives = {}, Suffix = 'Directive', - COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/, - CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/; + COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w_\-]+)\s+(.*)$/, + CLASS_DIRECTIVE_REGEXP = /(([\d\w_\-]+)(?:\:([^;]+))?;?)/; // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes // The assumption is that future DOM event attribute names will begin with