Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 9337142

Browse files
committed
CollectionUtils.hasOwnProperty --> CollectionUtils.hasProperty. As JSHint correctly stated: 'hasOwnProperty is a really bad name.'
1 parent 1aaba3c commit 9337142

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/language/JSUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@ define(function (require, exports, module) {
262262
rangeResults = [];
263263

264264
docEntries.forEach(function (docEntry) {
265-
// Need to call CollectionUtils.hasOwnProperty here since docEntry.functions could
265+
// Need to call CollectionUtils.hasProperty here since docEntry.functions could
266266
// have an entry for "hasOwnProperty", which results in an error if trying to
267267
// invoke docEntry.functions.hasOwnProperty().
268-
if (CollectionUtils.hasOwnProperty(docEntry.functions, functionName)) {
268+
if (CollectionUtils.hasProperty(docEntry.functions, functionName)) {
269269
var functionsInDocument = docEntry.functions[functionName];
270270
matchedDocuments.push({doc: docEntry.doc, fileInfo: docEntry.fileInfo, functions: functionsInDocument});
271271
}

src/utils/CollectionUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ define(function (require, exports, module) {
7171
* @param {string} property The name of the property to query
7272
* @return {boolean} True if the object contains the property
7373
*/
74-
function hasOwnProperty(object, property) {
74+
function hasProperty(object, property) {
7575
return Object.prototype.hasOwnProperty.apply(object, [property]);
7676
}
7777

7878
// Define public API
7979
exports.indexOf = indexOf;
8080
exports.forEach = forEach;
81-
exports.hasOwnProperty = hasOwnProperty;
81+
exports.hasProperty = hasProperty;
8282
});

src/utils/StringMatch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ define(function (require, exports, module) {
805805
}
806806

807807
// Load up the cached specials information (or build it if this is our first time through).
808-
var special = CollectionUtils.hasOwnProperty(this._specialsCache, str) ? this._specialsCache[str] : undefined;
808+
var special = CollectionUtils.hasProperty(this._specialsCache, str) ? this._specialsCache[str] : undefined;
809809
if (special === undefined) {
810810
special = findSpecialCharacters(str);
811811
this._specialsCache[str] = special;

0 commit comments

Comments
 (0)