Skip to content

Commit 4d41422

Browse files
Remove unused or non existing params to functions calls (#804)
* Remove unused param on the this.getWidget call in PropertyRow.js * Remove non existing second param to getObjectById and call this.select only if object is found * Remove non used source param from getDefaultValue function
1 parent 912da4c commit 4d41422

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Diff for: src/components/components/PropertyRow.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export default class PropertyRow extends React.Component {
144144
<label htmlFor={this.id} className="text" title={title}>
145145
{props.name}
146146
</label>
147-
{this.getWidget(props.schema.type)}
147+
{this.getWidget()}
148148
</div>
149149
);
150150
}

Diff for: src/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ Inspector.prototype = {
209209
this.select(this.camera);
210210
return;
211211
}
212-
this.select(this.scene.getObjectById(id, true));
212+
const object = this.scene.getObjectById(id);
213+
if (object) {
214+
this.select(object);
215+
}
213216
},
214217

215218
/**

Diff for: src/lib/entity.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function getImplicitValue(component, source) {
283283
if (value !== undefined) {
284284
isInherited = true;
285285
} else {
286-
value = getDefaultValue(component, null, source);
286+
value = getDefaultValue(component, null);
287287
}
288288
if (value !== undefined) {
289289
// XXX: This assumes parse is idempotent
@@ -313,7 +313,7 @@ function getImplicitValue(component, source) {
313313
if (propertyValue !== undefined) {
314314
isInherited = isInherited || true;
315315
} else {
316-
propertyValue = getDefaultValue(component, propertyName, source);
316+
propertyValue = getDefaultValue(component, propertyName);
317317
}
318318
if (propertyValue !== undefined) {
319319
var parse = component.schema[propertyName].parse;
@@ -430,11 +430,10 @@ function getInjectedValue(component, propertyName, source) {
430430
* @param {Component} component Component to be found.
431431
* @param {string} [propertyName] If provided, component's property to be
432432
* found.
433-
* @param {Element} source Element owning the component.
434433
* @return The component value coming from the schema
435434
* default.
436435
*/
437-
function getDefaultValue(component, propertyName, source) {
436+
function getDefaultValue(component, propertyName) {
438437
if (!propertyName) {
439438
return component.schema.default;
440439
}

0 commit comments

Comments
 (0)