complete JavaScriptWriter::write_fn