switch case with same value not compatibility with ACF

Description

The code below is not compatible with ACF. ACF does not allow same value in case

switch ("b") { case "a":break; case "a":break; case "b": writedump("good"); break; }

Affects Lucee 4.5 and 5

relates to

Activity

Show:

Michael Offner 30 January 2017 at 08:51

Estimate: 4h

Pothys - MitrahSoft 10 January 2017 at 11:32

I've added test case for this ticket & Confirmed the issue happen. In Lucee, switch case accepts the duplicate case
value without any error. In ACF, it working as expected.

Pull request: https://github.com/lucee/Lucee/pull/156

Brad Wood 6 January 2017 at 21:42

Seems like mostly a validation sort of thing. That's obviously bad code, but Adobe seems to be a bit more proactive about informing the user that they have a case that can never run. Well, technically it could run if there was no break in the first case, but it still wouldn't serve any purpose.

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Priority

Created 6 January 2017 at 21:38
Updated 20 May 2023 at 15:38

Flag notifications