[BUGFIX] t3editor: Harden some checks for TS parsing 00/60900/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 7 Jun 2019 15:52:39 +0000 (17:52 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 14 Jun 2019 19:14:01 +0000 (21:14 +0200)
Resolves: #88262
Resolves: #85346
Releases: master, 9.5
Change-Id: Ia72ef1b670841d90ec0251c99b7f4d3dc1e7770a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60900
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Tested-by: Sven Juergens <typo3@blue-side.de>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/t3editor/Resources/Public/JavaScript/Mode/typoscript/typoscript.js

index b42f1e5..e974cf0 100644 (file)
       // (Less wasteful than consing up a hundred closures on every call.)
       cx.state = state;
       cx.stream = stream;
-      cx.marked = null, cx.cc = cc;
+      cx.marked = null;
+      cx.cc = cc;
       cx.style = style;
 
       if (!state.lexical.hasOwnProperty("align"))
 
       while (true) {
         var combinator = cc.length ? cc.pop() : statement;
-        if (combinator(type, content)) {
-          while (cc.length && cc[cc.length - 1].lex)
+        if (typeof combinator === 'function' && combinator(type, content)) {
+          while (cc.length && cc[cc.length - 1] && cc[cc.length - 1].lex)
             cc.pop()();
           if (cx.marked) return cx.marked;
           if (type === "variable" && inScope(state, content)) return "variable-2";