From d8b463c0e7a8513d834243f9cc26cd16103431fa Mon Sep 17 00:00:00 2001 From: bencummins Date: Fri, 16 Mar 2018 01:31:23 +0000 Subject: [PATCH] Match any case for the "as" keyword. When using anything other than 'as' it was causing the parseScopeSyntax function to throw an exception. Among other things, this caused an issue with web pack setting in an infinite loops trying to compile. --- src/reactTemplates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reactTemplates.js b/src/reactTemplates.js index 8065e90a..dc7606c1 100644 --- a/src/reactTemplates.js +++ b/src/reactTemplates.js @@ -490,7 +490,7 @@ function parseScopeSyntax(text) { // // regex = capture(expression) + as + capture(id) + optional_spaces + semicolon + optional_spaces - const regex = RegExp("((?:(?:\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"|'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'|[^\"']*?))*?) as(?: )+([$_a-zA-Z]+[$_a-zA-Z0-9]*)(?: )*(?:;|$)(?: )*", 'g') + const regex = RegExp("((?:(?:\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"|'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'|[^\"']*?))*?) [Aa][Ss](?: )+([$_a-zA-Z]+[$_a-zA-Z0-9]*)(?: )*(?:;|$)(?: )*", 'g') const res = [] do { const idx = regex.lastIndex