Adds an ability to pass functions to `assert` and `deprecate`
Updates `loc` helper to use new assert syntax
Merge pull request #9553 from twokul/assert

Adds an ability to pass functions to `assert` and `deprecate`