Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#15755 closed task (fixed)

[meta] return statement after throw meaningless

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.8
Component: General Version: 1.8.0rc1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

The "return -1" in code like this is meaningless:

_assertIsAttribute: function(/* String */ attribute){
	// summary:
	//		This function tests whether the item passed in is indeed a valid 'attribute' like type for the store.
	// attribute:
	//		The attribute to test for being contained by the store.
	// returns:
	//		Returns the index (column) that the attribute resides in the row.
	if(typeof attribute !== "string"){
		throw new Error("dojo.data.HtmlStore: a function was passed an attribute argument that was not an attribute name string");
		return -1;
	}
	return array.indexOf(this._headings, attribute); //int
},

Attachments (1)

return_after_throw.patch (1.7 KB) - added by bill 7 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 7 years ago by bill

Component: DojoX DataGeneral
Description: modified (diff)
Summary: HtmlStore unreachable code[meta] return statement after throw meaningless

Changed 7 years ago by bill

Attachment: return_after_throw.patch added

comment:2 Changed 7 years ago by bill

Owner: changed from Kris Zyp to bill
Status: newassigned

comment:3 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [29392]:

return after throw is meaningless, fixes #15755 !strict

comment:4 Changed 7 years ago by bill

Milestone: tbd1.8
Note: See TracTickets for help on using tickets.