QubitProducts / cherrytree

A flexible nested router.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Throw an exception when shadowing context

KidkArolis opened this issue · comments

If the parent route has a key "foo" in the context and the child route tries to set "foo" in the context - throw an exception. This is most likely an error. You typically never want to overwrite / shadow the context.

And it's easy to do so accidentally by returning some raw $.fetch in the model hook which resolves to an object with many attributes whose names might clash with the names of resources. In those cases you meant to return {} or {myObject: $.fetch(...)} instead of the result of the fetch.

Not relevant in 2.0.0