Opened 14 years ago
Last modified 13 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 14 years ago by
comment:2 Changed 14 years ago by
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 13 years ago by
Status: | new → confirmed |
---|---|
Version: | → 3.0 |
comment:4 Changed 13 years ago by
I have inserted the below into link.js
function myX(){var a;delete a;}
and received
function A(){var G;delete G.a;}
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.