Opened 16 years ago

Closed 16 years ago

#1620 closed Bug (duplicate)

semicolon added before finally keyword

Reported by: Joe Wieloch Owned by:
Priority: Normal Milestone:
Component: Project : CKPackager Version:
Keywords: Cc:

Description

Noticed this when packing. Something like this:

	try
	{
		a=b;
	}
	catch ( e )
	{
		a=c;
	}
	finally
	{
		d=a;
	}

Packs to something like this:

	try{a=b;}catch(e){a=c;};finally{d=a;}

The semicolon before the finally breaks the script.

I changed fckpackager.php from this:

		// Concatenate lines that end with "}" using a ";" (except for "else" and "catch" cases).
		$script = preg_replace(
			'/\s*}\s*[\n\r]+\s*(?!\s*(else|catch|}))/s',
			'};', $script ) ;

to this and it corrects the problem mentioned here:

		// Concatenate lines that end with "}" using a ";" (except for "else" "catch" and "finally" cases).
		$script = preg_replace(
			'/\s*}\s*[\n\r]+\s*(?!\s*(else|catch|finally|}))/s',
			'};', $script ) ;

Change History (1)

comment:1 Changed 16 years ago by Wojciech Olchawa

Resolution: duplicate
Status: newclosed

DUP of #1239

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