Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Let JSVAL_IS_OBJECT only check for objects, not null
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tom Schuster  
View profile  
 More options May 5 2012, 1:50 pm
Newsgroups: mozilla.dev.tech.js-engine
From: Tom Schuster <t...@schuster.me>
Date: Sat, 5 May 2012 19:50:24 +0200
Local: Sat, May 5 2012 1:50 pm
Subject: Let JSVAL_IS_OBJECT only check for objects, not null
Hello!

I was looking into removing any use of JSVAL_IS_OBJECT from the
mozilla codebase. Turns out that this function would really win in
usefulness if it wouldn't return true for |null|. So I am proposing to
do that, let JSVAL_IS_OBJECT do what it says, return true _only_ for
JSObjects. Furthermore I propose that JSVAL_TO_OBJECT also only
returns objects and not null, thus probably getting rid of a lot of
null checks.

This way we could also get rid of the terrible !JSVAL_IS_PRIMITIVE
anti-pattern. We use these functions quite a few times and I would
think embedders do that too.

So my question is how useful feasible is this?

~Tom


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Blake Kaplan  
View profile  
 More options May 9 2012, 9:36 am
Newsgroups: mozilla.dev.tech.js-engine
From: Blake Kaplan <mrb...@mozilla.com>
Date: Wed, 09 May 2012 15:36:32 +0200
Local: Wed, May 9 2012 9:36 am
Subject: Re: Let JSVAL_IS_OBJECT only check for objects, not null
On 05/05/2012 07:50 PM, Tom Schuster wrote:

> So my question is how useful feasible is this?

It seems to me like this is basically going to happen for "free" with
the introduction of JS::Value (which already makes this distinction).
There are places in our tree right now where we depend on the current
behavior and a change like this would introduce very subtle bugs.
ECMAScript 5 didn't make the typeof null -> "null" change for the same
reason.

-Blake


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom Schuster  
View profile  
 More options May 9 2012, 2:10 pm
Newsgroups: mozilla.dev.tech.js-engine
From: Tom Schuster <t...@schuster.me>
Date: Wed, 9 May 2012 20:10:15 +0200
Local: Wed, May 9 2012 2:10 pm
Subject: Re: Let JSVAL_IS_OBJECT only check for objects, not null
On Wed, May 9, 2012 at 3:36 PM, Blake Kaplan <mrb...@mozilla.com> wrote:
> On 05/05/2012 07:50 PM, Tom Schuster wrote:
>> So my question is how useful feasible is this?

> It seems to me like this is basically going to happen for "free" with
> the introduction of JS::Value (which already makes this distinction).

Probably not for free, because this is serious work to port over. And
some code might only be compilable in C mode?
> There are places in our tree right now where we depend on the current
> behavior and a change like this would introduce very subtle bugs.

Not a big deal, I already fixed this stuff in our tree. I was more
interested in how this would affect other embedders.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »