Opened 14 years ago

Closed 13 years ago

#5089 closed Bug (fixed)

Problems with compressing named anonymous functions

Reported by: Wiktor Walc Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.5.1
Component: Project : CKPackager Version:
Keywords: Cc:

Description

When compressing the following code:

function a() {
	return function b(){};
};

it is changed into:

function a(){return function b(){b=;};;};

note that in the final result there is a javascript error: b=;

Attachments (4)

5089.patch (2.9 KB) - added by Wiktor Walc 14 years ago.
ckpackager.jar (905.3 KB) - added by Wiktor Walc 14 years ago.
5089_2.patch (2.1 KB) - added by Garry Yao 13 years ago.
5089_3.patch (2.1 KB) - added by Wiktor Walc 13 years ago.

Download all attachments as: .zip

Change History (9)

Changed 14 years ago by Wiktor Walc

Attachment: 5089.patch added

Changed 14 years ago by Wiktor Walc

Attachment: ckpackager.jar added

comment:1 Changed 14 years ago by Wiktor Walc

Keywords: Review? added
Owner: set to Wiktor Walc

comment:2 Changed 13 years ago by Wiktor Walc

Milestone: CKEditor 3.5.1

It was causing problems in CKFinder and it may be a matter of time when we experience this bug in CKEditor.

Changed 13 years ago by Garry Yao

Attachment: 5089_2.patch added

comment:3 Changed 13 years ago by Garry Yao

Owner: changed from Wiktor Walc to Garry Yao

Proposing a simplified patch.

Changed 13 years ago by Wiktor Walc

Attachment: 5089_3.patch added

comment:4 Changed 13 years ago by Wiktor Walc

Status: reviewreview_passed

Using function type looks smart. Please check the third patch I have uploaded - it works in the same way (at least I hope so). I'd prefer using there constants instead of numbers (FUNCTION_EXPRESSION vs 2, we don't need to keep the CKPackager code as short as possible) + I made one conditional statement simpler around L377.

So R+ from me for the second patch, if the third one looks good to you, go ahead ad commit it.

comment:5 Changed 13 years ago by Garry Yao

Resolution: fixed
Status: review_passedclosed

Fixed with [6330:6331].

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy