Quantcast
Channel: ajaxmin Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 683

Commented Unassigned: CKEditor (4.5.4) minification generates invalid javascript [22062]

$
0
0
The attached file (CKEditor 4.5.4 version) on the latest current version generates some invalid JavaScript when 'minified'. This only occurs when MinifyCode is set to true, running it through otherwise seems to generate no issues. No other options I've tried have had visible effects. We've resolved the issue by turning off code minification for this file, but it does suggest an underlying issue in the minifier, so I thought I'd post about it here.

Error: Uncaught SyntaxError: Unexpected token else

The area that generates the error (after minification) is enclosed below, specifically, the line with the emboldened 'else'.

```
if (n = n.data.domEvent.getKey(), n in e)
{
if (r = 8 == n, i = t.getSelection().getRanges()[0], n = i.startPath(), i.collapsed)
n:{
if (f = n.block, f && i[r ? "checkStartOfBlock" : "checkEndOfBlock"]() && i.moveToClosestEditablePosition(f, !r) && i.collapsed)
{
if (i.startContainer.type == CKEDITOR.NODE_ELEMENT && (o = i.startContainer.getChild(i.startOffset - (r ? 1 : 0)), o && o.type == CKEDITOR.NODE_ELEMENT && o.is("hr")))
{
t.fire("saveSnapshot");
o.remove();
n = !0;
break n
}
i = i.startPath().block;
!i || i && i.contains(f) ? n = void 0 : (t.fire("saveSnapshot"), (u = (r ? i : f).getBogus()) && u.remove(), u = t.getSelection(), o = u.createBookmarks(), (r ? f : i).moveChildren(r ? i : f, !1), n.lastElement.mergeSiblings(), s(f, i, !r), u.selectBookmarks(o), n = !0)
}
else
n = !1
};
__ else__
r = i,
u = n.block,
i = r.endPath().block,
u && i && !u.equals(i) ? (t.fire("saveSnapshot"), (f = u.getBogus()) && f.remove(), r.enlarge(CKEDITOR.ENLARGE_INLINE), r.deleteContents(), i.getParent() && (i.moveChildren(u, !1), n.lastElement.mergeSiblings(), s(u, i, !0)), r = t.getSelection().getRanges()[0], r.collapse(1), r.optimize(), "" === r.startContainer.getHtml() && r.startContainer.appendBogus(), r.select(), n = !0) : n = !1;
return n ? (t.getSelection().scrollIntoView(), t.fire("saveSnapshot"), !1) : void 0
}
```
Comments: ** Comment from web user: Pzenarch **

Alas, my attempt to embolden the problem line didn't work.

```
__ else__
```
This line shouldn't have the underscores next to it, but this is the line that generates the issue.


Viewing all articles
Browse latest Browse all 683

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>