Opened 9 years ago

Last modified 7 years ago

#5993 confirmed Bug

[CKPackager] JavaScript delete statement breaks minified code

Reported by: Marc Nilius Owned by:
Priority: Normal Milestone:
Component: Project : CKPackager Version: 3.0
Keywords: Cc:

Description

I wrote a CKEditor plugin and used CKPackager to create a new ckeditor.js. This new file had some javascript errors. This happened, because the CKPackager broke a code snippet when it tried to minify this snippet. I added a unit test to the test.js:
[ "function(){var a;delete a;}" ]
This test fails, too. The result of this test is
"function(){var a;delete a.a;}"

Now I always have to fix this manually in the created ckeditor.js. Would be great, if this could be fixed.

Thanks in advance.

Greets, Marc

Change History (4)

comment:1 Changed 9 years ago by Frederico Caldeira Knabben

Ok, valid ticket, but be aware that "delete" cannot be used to delete local variables, just object properties. So you would do better fixing your code, avoiding the CKPackager issue.

comment:2 Changed 9 years ago by Marc Nilius

Hi!

Yes, you are right. Thanks for this info. In my context this statement was useless. Although, this is valid javascript (just returning false) and it should not break on minification.

comment:3 Changed 7 years ago by Jakub Ś

Status: newconfirmed
Version: 3.0

comment:4 Changed 7 years ago by Jakub Ś

I have inserted the below into link.js

function myX(){var a;delete a;}

and received

function A(){var G;delete G.a;}
Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy