W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2013

Re: comments on Matrix

From: Benoit Jacob <jacob.benoit.1@gmail.com>
Date: Fri, 22 Mar 2013 12:59:23 -0400
Message-ID: <CAJTmd9oUf-rtoSgr95FiH+J=ePqdBKvf5Vb4ueuL3wCLJKfpnA@mail.gmail.com>
To: Rik Cabanier <cabanier@gmail.com>
Cc: robert@ocallahan.org, "Tab Atkins Jr." <jackalmage@gmail.com>, "public-fx@w3.org" <public-fx@w3.org>
2013/3/22 Rik Cabanier <cabanier@gmail.com>

>
>
> On Fri, Mar 22, 2013 at 9:51 AM, Benoit Jacob <jacob.benoit.1@gmail.com>wrote:
>
>>
>>
>> 2013/3/22 Rik Cabanier <cabanier@gmail.com>
>>
>>>
>>>
>>> On Fri, Mar 22, 2013 at 1:48 AM, Robert O'Callahan <robert@ocallahan.org
>>> > wrote:
>>>
>>>> On Fri, Mar 22, 2013 at 7:48 AM, Rik Cabanier <cabanier@gmail.com>wrote:
>>>>
>>>>>  On Thu, Mar 21, 2013 at 11:38 AM, Tab Atkins Jr. <
>>>>> jackalmage@gmail.com> wrote:
>>>>>
>>>>>> Only if you actually throw it.  It's not eagerly created every call.
>>>>>>
>>>>>
>>>>> I worked a little with the mozilla code base and it seems that they
>>>>> always create the object.
>>>>> It's probably not a huge amount of overhead since it's not dynamically
>>>>> allocated.
>>>>>
>>>>
>>>> We certainly don't create a JS exception object if an exception is not
>>>> actually thrown.
>>>>
>>>
>>> If a function is marked as throwing in the IDL, doesn't it get an
>>> exception object as a parameter on the C++ side?
>>>
>>
>> No, in Mozilla's case it gets a so-called ErrorResult object,
>>
>>
>> http://dxr.mozilla.org/mozilla-central/dom/bindings/ErrorResult.h?from=ErrorResult#l34
>>
>> C++ can then decide to call its Throw() method to actually produce an
>> exception.
>
>
> Yes, that's the one I was thinking of.
>
>
Well, the argument was over whether that would be expensive. It's not (C++
object created on the stack, with its constructor just setting one integer
member to a constant -- so a few cycles at most).

Benoit
Received on Friday, 22 March 2013 16:59:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:45 UTC