Prevent JS error with hint is set, fix #1888
- Adding assertJSExpression to check in JavaScript