Array map member function skips null values

Description

Scenario: call map() on an array that contains null values.

What I expected:
1) The new array should have the same length as the original array.
2) Each item in the new array should have the value returned from the map function.

What actually happened:
1) If the original array has nothing but null values, the new array has a length of 0.
2) If the original array contains a mix of null and non-null values, it is impossible to map the null values to a different value.

TryCF gist: https://trycf.com/gist/f586d22f312910ec1814b235522f97fe/lucee5?theme=monokai

Environment

None

Activity

Show:
Zac Spitzer
October 17, 2019, 12:58 PM

As this works on ACF 2018, can you add the acf-compat label?

Ryan Deba
October 17, 2019, 1:47 PM

Label added

Pothys - MitrahSoft
October 18, 2019, 10:08 AM

I've added a test case and confirmed the issue that happened on lucee. In lucee ignores the null value. But ACF includes the null value.

Pull Request: https://github.com/lucee/Lucee/pull/775

Assignee

Michael Offner

Reporter

Ryan Deba

Priority

Major

Labels

Fix versions

None

Affects versions

Configure