Skip to content

Upgrade to ES6: Arrays with added prototype properties break #37

@joshjung

Description

@joshjung

Note: this bug actually exists in the HashArray code but I'm putting it here since this library is the primary user of HashArray.

For example, if you do this somewhere in your code:

Array.prototype.range = function() {
  ...
};

The HashArray breaks here:

  //-----------------------------------
  // add()
  //-----------------------------------
  addOne: function (obj) {
    var needsDupCheck = false;
    for (var key in this.keyFields) {
      key = this.keyFields[key];
      var inst = this.objectAt(obj, key);

This was written eons ago and really just needs to be updated to ES6 or TypeScript as per someone else's request and fork.

Anyway, putting this ticket here so I can take a look at it when I have some free time. In the meantime, TrieSearch does not work if you do fancy global manipulations to the Array.prototype.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions