Fix a few js compile errors

* Document optional parameter
* Remove no-op if statement
* Remove use of deprecated function