Skip to content

Commit b512174

Browse files
f-fwing328
authored andcommitted
[JavaScript] Remove default parameters syntax, as it's an ES6 feature (#2848)
* Remove default parameters in JS client, as it's an ES6 feature * update js petstore samples
1 parent 25dce23 commit b512174

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,8 @@
651651
];
652652
};
653653

654-
exports.getBasePathFromSettings = function(index, variables={}) {
654+
exports.getBasePathFromSettings = function(index, variables) {
655+
var variables = variables || {};
655656
var servers = this.hostSettings();
656657

657658
// check array index out of bound

samples/client/petstore/javascript-promise/src/ApiClient.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,8 @@
598598
];
599599
};
600600

601-
exports.getBasePathFromSettings = function(index, variables={}) {
601+
exports.getBasePathFromSettings = function(index, variables) {
602+
var variables = variables || {};
602603
var servers = this.hostSettings();
603604

604605
// check array index out of bound

samples/client/petstore/javascript/src/ApiClient.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,8 @@
609609
];
610610
};
611611

612-
exports.getBasePathFromSettings = function(index, variables={}) {
612+
exports.getBasePathFromSettings = function(index, variables) {
613+
var variables = variables || {};
613614
var servers = this.hostSettings();
614615

615616
// check array index out of bound

0 commit comments

Comments
 (0)