At compile-time find references to variables not defined in the datamodel, and complain
Accumulate variables declared in the datamodel. Flow through javascript expressions, and look for identifiers. If you see an identifier that does not existing in the datamodel, then throw a compile-time error.