-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaScript driver - Clean r.connect #1577
Comments
I would prefer to keep the first version. It's fairly common to run rethink on the default port, and the first version is a nice shortcut. I use it quite often, and it would be a pain to type out the full object. We of course should fix the safety bug you mentioned. |
That makes sense. Ok, let's just fix the safety check. |
Branch michel_1577_connect |
Python also supports the first syntax btw. So we support it everywhere. |
Merged in next as 97113cf |
r.connect
in the JavaScript currently has two syntaxes:If no one has strong objection, I would like to remove the first one. That way we would have the same syntax across the three drivers and that would make the driver a little less complex.
Note that you cannot pass a string like
"localhost:28015"
or anything else. Nothing is parsed.The check on line 403 is not safe too (for the type of
host
)If
host
isnull
, no error is thrown there, but one is thrown because we try to read the propertyhost
ofnull
(line 72)If
host
is anarray
, no error are thrown, and the result is like passing an empty object.If
host
isundefined
, an error will be thrown on line 403, which make the test on line 67 useless.The text was updated successfully, but these errors were encountered: