Report syntax error position for tag attributes

Syntax errors on tag attributes result in Function() throwing an error. No information indicating error position is shown. This change checks the js first and reports the error and position if syntax is bad.