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

  • SEARCH
  • Home
  • 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 8071441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:41:41+00:00 2026-06-05T13:41:41+00:00

Both firefox’s js engine/gjs (spidermonkey) and webkit’s jscore seems to have different behavior when

  • 0

Both firefox’s js engine/gjs (spidermonkey) and webkit’s jscore seems to have different behavior when calling builtin and normal js functions on non-object.

gjs> toString.call(null)
"[object Null]"
gjs> function cccc() {return toString.call(this);}
gjs> cccc.call(null)
"[object GjsGlobal]"

So if a normal js function is called with non-object, its this is automatically get replaced by the current this, whereas this won’t happen for a builtin function.

Is this the standard behavior (according to some specification?) or is it just a implementation dependent behavior?
Is the first line always safe to check the type of any value?

THX

  • 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-06-05T13:41:42+00:00Added an answer on June 5, 2026 at 1:41 pm

    That behaviour is by design. As noted in the Mozilla documentation:

    Note that this may not be the actual value seen by the method: if the
    method is a function in non-strict mode code, null and undefined will
    be replaced with the global object, and primitive values will be
    boxed.

    Apparently, builtin functions are (treated as) strict mode code. Your own functions are not, unless, of course, you write a strict mode function. 🙂

    This will be different in ECMAScript 5. From the specification (PDF):

    NOTE The thisArg value is passed without modification as the this
    value. This is a change from Edition 3, where a undefined or null
    thisArg is replaced with the global object and ToObject is applied to
    all other values and that result is passed as the this value.

    Here’s a more direct link to a non-normative but HTML version of the spec.

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

Sidebar

Related Questions

All of the sudden (at least so it seems), both Chrome and Firefox behave
I get this behavior in both Chrome (Developer Tools) and Firefox (Firebug). Note the
I am observing, on both Firefox and IE, that if I have a cookie
I have an HTTP response of HTTP/1.0 200 OK\r\n\r\n <!DOCTYPE html>... Both Firefox and
As far as I know both FireFox and Safari can not work with Kerberos
Please view the below code as html in both firefox, and other browsers such
Are there any extensions that are hybrid on both Firefox and Chrome platform? I
The script works perfect both in Firefox and Opera. $(document).ready(function() { $('#mainTable tr').each(function() {
I'm getting errors, in both chrome and firefox developer tools, when trying to evaluate
My CSS for the website all looks fine in Firefox but in both Chrome

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.