Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

In filters, use isArray instead of instanceof #1966

Closed
wants to merge 2 commits into from
Closed

In filters, use isArray instead of instanceof #1966

wants to merge 2 commits into from

Conversation

Ivshti
Copy link

@Ivshti Ivshti commented Feb 6, 2013

Use the built-in isArray instead of "instanceof Array".
In the node-webkit framework, arrays may be created in the Node.js context, and for those arrays "instanceof Array" will return false, because the Array object of the browser context is a different reference. Using "Array.isArray" or the AngularJS function isArray fixes the problem.

@IgorMinar
Copy link
Contributor

PR Checklist (Minor Bugfix)

  • Contributor signed CLA now or in the past (if you just signed, leave a comment here with your real name)
  • PR doesn't introduce new api
  • PR doesn't contain a breaking change
  • PR contains unit tests
  • PR contains e2e tests (if suitable)
  • PR contains documentation update (if suitable)
  • PR passes all tests on Travis (sanity)
  • PR passes all tests on ci.angularjs.org (cross-browser compatibility)
  • PR is rebased against recent master
  • PR is squashed into one commit per logical change
  • PR's commit messages are descriptive and allows us to autogenerate release notes (required commit message format)
  • All changes requested in review have been implemented

@IgorMinar
Copy link
Contributor

Is there an easy way to create a browser based unit test for this? I can't think of any, so I'm ok with skipping unit tests for this one. please squash into a single commit, update commit message and sign CLA if you haven't yet.

@ghost ghost assigned IgorMinar Feb 15, 2013
IgorMinar added a commit that referenced this pull request Feb 15, 2013
this breaks when multiple javascript contexts are involved - like in node-webkit

see original PR: #1966

Closes #1966
@IgorMinar IgorMinar closed this in 3c2aee0 Feb 15, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants