aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2016-03-28 12:46:42 -0700
committerGravatar murgatroid99 <mlumish@google.com>2016-03-28 12:46:42 -0700
commit51b81c1e5555c2dd0a2198a72b59d4cba8174e12 (patch)
treeb512269712bfa48fedf83f1fdec02fd50ad4619d
parent27b8d900bcabb440452eac6cf110d34a56933dfd (diff)
Make option passing down to the client constructor more consistent
-rw-r--r--src/node/src/client.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/node/src/client.js b/src/node/src/client.js
index e589c0322d..82142379da 100644
--- a/src/node/src/client.js
+++ b/src/node/src/client.js
@@ -695,7 +695,8 @@ var deprecated_request_wrap = {
* responseDeserialize: function to deserialize response objects
* @param {Object} methods An object mapping method names to method attributes
* @param {string} serviceName The fully qualified name of the service
- * @param {boolean=} deprecatedArgumentOrder Indicates that the old argument
+ * @param {Object} class_options An options object. Currently only uses the key
+ * deprecatedArgumentOrder, a boolean that Indicates that the old argument
* order should be used for methods, with optional arguments at the end
* instead of the callback at the end. Defaults to false. This option is
* only a temporary stopgap measure to smooth an API breakage.
@@ -703,7 +704,10 @@ var deprecated_request_wrap = {
* @return {function(string, Object)} New client constructor
*/
exports.makeClientConstructor = function(methods, serviceName,
- deprecatedArgumentOrder) {
+ class_options) {
+ if (!class_options) {
+ class_options = {};
+ }
/**
* Create a client with the given methods
* @constructor
@@ -752,7 +756,7 @@ exports.makeClientConstructor = function(methods, serviceName,
var deserialize = attrs.responseDeserialize;
var method_func = requester_makers[method_type](
attrs.path, serialize, deserialize);
- if (deprecatedArgumentOrder) {
+ if (class_options.deprecatedArgumentOrder) {
Client.prototype[name] = deprecated_request_wrap(method_func);
} else {
Client.prototype[name] = method_func;