Forget allowing "age discrimination": You'd be hard-pressed to find a legal code in the world that doesn't _codify_ "age discrimination" when it comes to the adult/child line. It's honestly stretching the term beyond its common usage to include the child/adult line.
Well, a legal code can both codify discrimination against children in some specific contexts, and broadly ban it in others. (It's true, the term "age discrimination" has been coopted to refer to discrimination against older people.)