Skip to content

Commit 142b9d4

Browse files
authored
Issue warning for shadowed local variables (#3487)
* Issue warning for shadowed local variables. * Client SDK changes for UndefinedError * Added shadowed variable warning to changelog
1 parent e257fcb commit 142b9d4

File tree

5 files changed

+215
-0
lines changed

5 files changed

+215
-0
lines changed

client/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ Class | Method | HTTP request | Description
188188
- [RaiDbSdk.S3Integration](docs/S3Integration.md)
189189
- [RaiDbSdk.SetOptionsAction](docs/SetOptionsAction.md)
190190
- [RaiDbSdk.SetOptionsActionResult](docs/SetOptionsActionResult.md)
191+
- [RaiDbSdk.ShadowError](docs/ShadowError.md)
191192
- [RaiDbSdk.Source](docs/Source.md)
192193
- [RaiDbSdk.StatusAction](docs/StatusAction.md)
193194
- [RaiDbSdk.StatusActionResult](docs/StatusActionResult.md)

client/docs/ShadowError.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# RaiDbSdk.ShadowError
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**range** | [**Range**](Range.md) | |
8+
**shadowed** | [**AnyType**](.md) | | [optional]
9+
**shadower** | [**AnyType**](.md) | | [optional]
10+
**_var** | **String** | | [default to '']
11+
12+

client/src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import Relation from './model/Relation';
7676
import S3Integration from './model/S3Integration';
7777
import SetOptionsAction from './model/SetOptionsAction';
7878
import SetOptionsActionResult from './model/SetOptionsActionResult';
79+
import ShadowError from './model/ShadowError';
7980
import Source from './model/Source';
8081
import StatusAction from './model/StatusAction';
8182
import StatusActionResult from './model/StatusActionResult';
@@ -504,6 +505,12 @@ export {
504505
*/
505506
SetOptionsActionResult,
506507

508+
/**
509+
* The ShadowError model constructor.
510+
* @property {module:model/ShadowError}
511+
*/
512+
ShadowError,
513+
507514
/**
508515
* The Source model constructor.
509516
* @property {module:model/Source}

client/src/model/ShadowError.js

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/**
2+
* Delve Client SDK
3+
* This is a Client SDK for Delve API
4+
*
5+
* The version of the OpenAPI document: 1.1.3
6+
* Contact: support@relational.ai
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*
12+
*/
13+
14+
import ApiClient from '../ApiClient';
15+
import AnyType from './AnyType';
16+
import FrontProblem from './FrontProblem';
17+
import Range from './Range';
18+
19+
/**
20+
* The ShadowError model module.
21+
* @module model/ShadowError
22+
* @version 1.1.3
23+
*/
24+
class ShadowError {
25+
/**
26+
* Constructs a new <code>ShadowError</code>.
27+
* @alias module:model/ShadowError
28+
* @extends module:model/FrontProblem
29+
* @implements module:model/FrontProblem
30+
* @param type {String}
31+
*/
32+
constructor(type) {
33+
FrontProblem.initialize(this, type);
34+
ShadowError.initialize(this, type);
35+
}
36+
37+
/**
38+
* Initializes the fields of this object.
39+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
40+
* Only for internal use.
41+
*/
42+
static initialize(obj, type) {
43+
obj['range'] = range;
44+
obj['var'] = _var || '';
45+
}
46+
47+
/**
48+
* Constructs a <code>ShadowError</code> from a plain JavaScript object, optionally creating a new instance.
49+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
50+
* @param {Object} data The plain JavaScript object bearing properties of interest.
51+
* @param {module:model/ShadowError} obj Optional instance to populate.
52+
* @return {module:model/ShadowError} The populated <code>ShadowError</code> instance.
53+
*/
54+
static constructFromObject(data, obj) {
55+
if (data) {
56+
obj = obj || new ShadowError();
57+
FrontProblem.constructFromObject(data, obj);
58+
FrontProblem.constructFromObject(data, obj);
59+
60+
if (data.hasOwnProperty('range')) {
61+
obj['range'] = Range.constructFromObject(data['range']);
62+
}
63+
if (data.hasOwnProperty('shadowed')) {
64+
obj['shadowed'] = ApiClient.convertToType(data['shadowed'], AnyType);
65+
}
66+
if (data.hasOwnProperty('shadower')) {
67+
obj['shadower'] = ApiClient.convertToType(data['shadower'], AnyType);
68+
}
69+
if (data.hasOwnProperty('var')) {
70+
obj['var'] = ApiClient.convertToType(data['var'], 'String');
71+
}
72+
}
73+
return obj;
74+
}
75+
76+
77+
}
78+
79+
/**
80+
* @member {module:model/Range} range
81+
*/
82+
ShadowError.prototype['range'] = undefined;
83+
84+
/**
85+
* @member {module:model/AnyType} shadowed
86+
*/
87+
ShadowError.prototype['shadowed'] = undefined;
88+
89+
/**
90+
* @member {module:model/AnyType} shadower
91+
*/
92+
ShadowError.prototype['shadower'] = undefined;
93+
94+
/**
95+
* @member {String} var
96+
* @default ''
97+
*/
98+
ShadowError.prototype['var'] = '';
99+
100+
101+
// Implement FrontProblem interface:
102+
/**
103+
* @member {String} type
104+
* @default ''
105+
*/
106+
FrontProblem.prototype['type'] = '';
107+
108+
109+
110+
111+
export default ShadowError;
112+
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/**
2+
* Delve Client SDK
3+
* This is a Client SDK for Delve API
4+
*
5+
* The version of the OpenAPI document: 1.1.3
6+
* Contact: support@relational.ai
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*
12+
*/
13+
14+
(function(root, factory) {
15+
if (typeof define === 'function' && define.amd) {
16+
// AMD.
17+
define(['expect.js', process.cwd()+'/src/index'], factory);
18+
} else if (typeof module === 'object' && module.exports) {
19+
// CommonJS-like environments that support module.exports, like Node.
20+
factory(require('expect.js'), require(process.cwd()+'/src/index'));
21+
} else {
22+
// Browser globals (root is window)
23+
factory(root.expect, root.RaiDbSdk);
24+
}
25+
}(this, function(expect, RaiDbSdk) {
26+
'use strict';
27+
28+
var instance;
29+
30+
beforeEach(function() {
31+
instance = new RaiDbSdk.ShadowError();
32+
});
33+
34+
var getProperty = function(object, getter, property) {
35+
// Use getter method if present; otherwise, get the property directly.
36+
if (typeof object[getter] === 'function')
37+
return object[getter]();
38+
else
39+
return object[property];
40+
}
41+
42+
var setProperty = function(object, setter, property, value) {
43+
// Use setter method if present; otherwise, set the property directly.
44+
if (typeof object[setter] === 'function')
45+
object[setter](value);
46+
else
47+
object[property] = value;
48+
}
49+
50+
describe('ShadowError', function() {
51+
it('should create an instance of ShadowError', function() {
52+
// uncomment below and update the code to test ShadowError
53+
//var instane = new RaiDbSdk.ShadowError();
54+
//expect(instance).to.be.a(RaiDbSdk.ShadowError);
55+
});
56+
57+
it('should have the property range (base name: "range")', function() {
58+
// uncomment below and update the code to test the property range
59+
//var instane = new RaiDbSdk.ShadowError();
60+
//expect(instance).to.be();
61+
});
62+
63+
it('should have the property shadowed (base name: "shadowed")', function() {
64+
// uncomment below and update the code to test the property shadowed
65+
//var instane = new RaiDbSdk.ShadowError();
66+
//expect(instance).to.be();
67+
});
68+
69+
it('should have the property shadower (base name: "shadower")', function() {
70+
// uncomment below and update the code to test the property shadower
71+
//var instane = new RaiDbSdk.ShadowError();
72+
//expect(instance).to.be();
73+
});
74+
75+
it('should have the property _var (base name: "var")', function() {
76+
// uncomment below and update the code to test the property _var
77+
//var instane = new RaiDbSdk.ShadowError();
78+
//expect(instance).to.be();
79+
});
80+
81+
});
82+
83+
}));

0 commit comments

Comments
 (0)