Opened 18 years ago
Closed 18 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 ) ;

DUP of #1239