You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2020/07/24 12:19:12 UTC

[tinkerpop] 01/03: Update client.js

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 7894317148b37932b9d91dc0a5e597dac47b4662
Author: Gustavo Cavalieri Fernandes <gu...@gmail.com>
AuthorDate: Thu Jul 23 12:17:39 2020 -0300

    Update client.js
    
    Following the docs present in [here](https://github.com/apache/tinkerpop/blob/master/gremlin-javascript/src/main/javascript/gremlin-javascript/README.md), getting started with Gremlin throws the following error:
    
    ```bash
    /home/node/node_modules/gremlin/lib/driver/client.js:49
    if (this._options.processor === 'session') {
    TypeError: Cannot read property 'processor' of undefined
    at new Client (/home/node/node_modules/gremlin/lib/driver/client.js:49:23)
    at new DriverRemoteConnection (/home/node/node_modules/gremlin/lib/driver/driver-remote-connection.js:53:20)
    ```
    
    So, I suggest that we can pass a default empty object to the client constructor, what do you think?
---
 .../src/main/javascript/gremlin-javascript/lib/driver/client.js         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.js
index 519ccb4..eaa9db1 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.js
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/driver/client.js
@@ -44,7 +44,7 @@ class Client {
    * @param {String} [options.session] The sessionId of Client in session mode. Defaults to null means session-less Client.
    * @constructor
    */
-  constructor(url, options) {
+  constructor(url, options = {}) {
     this._options = options;
     if (this._options.processor === 'session') {
       // compatibility with old 'session' processor setting