Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:38:36+00:00 2026-05-28T00:38:36+00:00

I think I may have found a bug with Google Chrome (16.0.912.75 m, the

  • 0

I think I may have found a bug with Google Chrome (16.0.912.75 m, the latest stable at the time of this writing).

var FakeFancy = function () {};
console.log(new FakeFancy());

var holder = {
    assignTo : function (func) {
        holder.constructor = func;
    }
};

holder.assignTo(function () { this.type = 'anonymous' });
var globalConstructor = function () { this.type = 'global' }

console.log(new holder.constructor());

If you run that block in Firefox, it shows both listed as “Object” with the second having type = local, pretty good. But if you run it in Chrome, it shows

> FakeFancy
> globalConstructor.type

If you expand the trees, the contents are correct. But I can’t figure out what Chrome is listing as the first line for each object logged. Since I’m not manipulating the prototypes, these should be plain old objects that aren’t inheriting from anywhere.

At first, I thought it was WebKit related, but I tried in the latest Safari for Windows (5.1.2 7534.52.7) and both show up as “Object”.

I suspect that it’s attempting to do some guesswork about where the constructor was called from. Is the anonymous constructor’s indirection messing it up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:38:37+00:00Added an answer on May 28, 2026 at 12:38 am

    The first line is a result of

    console.log(new FakeFancy());
    

    The WebKit console generally tries to do “constructor name inference” to let you know what type of object it’s outputting. My guess is that the more recent version included with Chrome (as opposed to Safari 5.1) can do inference for constructor declarations like

    var FakeFancy = function () {};
    

    and not just ones like

    function FakeFancy() {}
    

    so that’s why you’re seeing the disparity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think I may have found a bug in PHP's crypt() function under Windows.
I think I may have found a bug in WebMatrix's PageData, but I am
I think this may be relatively straight forward. I have a rewrite rule that
Hopefully this question isn't as subjective as I think it may be. I have
I've found what I think may be a bug with Ivar and Objective-C runtime.
I have found the following post, which I think I may help because I
I think I may have found a problem with ASP.NET MVC and it's event
As per another question I had asked earlier I think I may have found
I'm learning about delegates and think I may have found a use for one.
I think I may have a misunderstanding of <xsl:variable\> and <xsl:value-of\> so perhaps someone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.