SpiderMonkey 1.8.1 now throwing TypeError when setting a property that has only a getter

View: New views
4 Messages — Rating Filter:   Alert me  

SpiderMonkey 1.8.1 now throwing TypeError when setting a property that has only a getter

by Pedro-57 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

According to https://bugzilla.mozilla.org/show_bug.cgi?id=478047,
newer versions of SpiderMonkey now throw a TypeError: setting a
property that has only a getter instead of silently ignoring the
assignment as before.

var o = { get p() { return "a"; } };
o.p = "b";
>>TypeError: setting a property that has only a getter

Although I understand the reasons behind the change, isn't Mozilla
worried about introducing a change that breaks backwards compatibility
with already existing JavaScript code? What's your take on this issue?

Thanks!
Pedro
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Re: SpiderMonkey 1.8.1 now throwing TypeError when setting a property that has only a getter

by Jason Orendorff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/21/2009 01:00 PM, Pedro wrote:

> Hi all,
>
> According to https://bugzilla.mozilla.org/show_bug.cgi?id=478047,
> newer versions of SpiderMonkey now throw a TypeError: setting a
> property that has only a getter instead of silently ignoring the
> assignment as before.
>
> var o = { get p() { return "a"; } };
> o.p = "b";
>>> TypeError: setting a property that has only a getter
>
> Although I understand the reasons behind the change, isn't Mozilla
> worried about introducing a change that breaks backwards compatibility
> with already existing JavaScript code? What's your take on this issue?

Hmm. My reading of the April 2009 draft is that ES5 requires the
TypeError in strict mode only. It requires that the assignment silently
do nothing in non-strict mode.

-j
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Re: SpiderMonkey 1.8.1 now throwing TypeError when setting a property that has only a getter

by Jason Orendorff-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/21/2009 01:00 PM, Pedro wrote:
> var o = { get p() { return "a"; } };
> o.p = "b";
>>> TypeError: setting a property that has only a getter

Filed bug 523846. Good catch!

-j
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Re: SpiderMonkey 1.8.1 now throwing TypeError when setting a property that has only a getter

by Pedro-57 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 22, 9:39 am, Jason Orendorff <jorendo...@...> wrote:
> On 10/21/2009 01:00 PM, Pedro wrote:
>
> > var o = { get p() { return "a"; } };
> > o.p = "b";
> >>> TypeError: setting a property that has only a getter
>
> Filed bug 523846. Good catch!
>
> -j

Thanks for taking action!
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine