Re: Should the entire JS structure be Object.freeze()'d if it's exposed through a read only property?

2015-07-30 Thread Anne van Kesteren
On Thu, Jul 30, 2015 at 9:00 AM, Tim Guan-tin Chien wrote: > This is not as convenient as a keyword in WebIDL but I think it's good enough. You might want to chime in on https://www.w3.org/Bugs/Public/show_bug.cgi?id=29004 which is asking for something similar (though more scoped). Note thou

Re: Should the entire JS structure be Object.freeze()'d if it's exposed through a read only property?

2015-07-30 Thread Tim Guan-tin Chien
Closing the loop here: With the help from :bholley the Cu.cloneInto() method now comes with an option to deepFreeze the cloned object. Those who interested can check out the bugs. https://bugzilla.mozilla.org/show_bug.cgi?id=1184439 https://bugzilla.mozilla.org/show_bug.cgi?id=1186213 This is no

Re: Should the entire JS structure be Object.freeze()'d if it's exposed through a read only property?

2015-07-14 Thread Boris Zbarsky
On 7/13/15 2:40 AM, Tim Guan-tin Chien wrote: In that case, the right question to ask would be (A) should DOMApplication#manifest be a recursive frozen JS structure Is it a plain vanilla object with nothing hanging off it that has getter/setters? If so, that would not be unreasonable. and

Re: Should the entire JS structure be Object.freeze()'d if it's exposed through a read only property?

2015-07-13 Thread Ehsan Akhgari
On 2015-07-13 2:40 AM, Tim Guan-tin Chien wrote: On Fri, Jul 10, 2015 at 2:45 AM, Boris Zbarsky wrote: On 7/9/15 4:48 AM, Tim Guan-tin Chien wrote: In this case, I modified the manifest object passed from mozApp API, and the object was subsequently removed by the platform, so did my modificat

Re: Should the entire JS structure be Object.freeze()'d if it's exposed through a read only property?

2015-07-12 Thread Tim Guan-tin Chien
On Fri, Jul 10, 2015 at 2:45 AM, Boris Zbarsky wrote: > On 7/9/15 4:48 AM, Tim Guan-tin Chien wrote: >> >> In this case, I modified the manifest object passed from mozApp API, >> and the object was subsequently removed by the platform, so did my >> modifications. Fabrice said I should not be modif

Re: Should the entire JS structure be Object.freeze()'d if it's exposed through a read only property?

2015-07-09 Thread Boris Zbarsky
On 7/9/15 4:48 AM, Tim Guan-tin Chien wrote: In this case, I modified the manifest object passed from mozApp API, and the object was subsequently removed by the platform, so did my modifications. Fabrice said I should not be modified the object since it's marked as read only in WebIDL. "readonl