location is not an instance of Location

Confirmed Issue #14307901 • Assigned to Fei W.


Oct 19, 2017
This issue is public.
Found in
  • Microsoft Edge
  • Internet Explorer
Found in build #
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Confusingly, while window.location reports that its constructor is window.Location, it is not an instance of window.Location.

Console session in Edge, at the msn.com start page:

< “Location”
window.location.proto.constructor === window.Location
< true
window.location instanceof window.Location
< false
window.location instanceof window.location.proto.constructor
< false

The first two results make good sense - window.location’s constructor is called “Location” and is the window.Location object, but somehow not only is window.location not an instance of Location, but it isn’t even an instance of its own constructor.

This kind of thing can cause issues with any code that tests the type of something with instanceof in a systematic way, trying to provide typesafety when going between JavaScript and another language.


Comments and activity

  • Apologies, > symbols didn’t render correctly, nor did __proto__, and I can’t seem to edit to correct this.

  • Microsoft Edge Team

    Changed Assigned To to “Steven K.”

  • Hi,

    No worries about the syntax rending.  I don’t know many of the rules for the markup language for this site, or I could provide advice on that.  The image is a good work around along with the console’s autocomplete feature.  :-)

    I was able to repro this.  Thank you for the submission.  Nice find.


  • Microsoft Edge Team

    Changed Assigned To to “travil”

    Changed Assigned To from “travil” to “Fei W.”

    Changed Status to “Confirmed”

You need to sign in to your Microsoft account to add a comment.

Sign in