FLUID-6217: `fluid.get` returns the parent value inappropriately when the parent value is "falsy"...

Metadata

Source
FLUID-6217
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Antranig Basman
Reporter
Tony Atkins [RtF]
Created
2017-10-30T10:21:13.672-0400
Updated
2024-07-22T09:01:41.003-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. Framework

Description

If a parent value is "falsy", fluid.get will return the parent value instead of undefined when an attempt is made to locate a child value.

fluid.get([0,1,2],"0.value"); // returns 0
fluid.get([0,1,2],"0.any.path.at.all"); // returns 0
fluid.get([0, false, 2],"1.foo.bar.baz"); // returns false
fluid.get({foo:false}, "foo.bar.baz"); // returns false

The expected value for each of these cases is undefined.

Comments

  • Cindy Li commented 2017-11-02T15:17:01.497-0400

    The pull request has been merged into the project repo master branch at c0636b395d691e986dd539c804fef78b799f7240