[webkit-dev] JSC Suggestion: Class property locking

Brian Barnes ggadwa at charter.net
Tue Aug 18 12:35:58 PDT 2009


Thanks, I'll just wait until you guys implement this, because right now 
I have the shortest path (i.e., all static properties and functions on 
the class) and adding a getter/setter would be more time in my code.

[>] Brian

Oliver Hunt wrote:
> EcmaScript 5 defines a number of functions (freeze, seal, 
> preventExtensions) that basically do this -- we just haven't yet 
> implemented these.
>
> But you can provide custom get and put functions which you could just 
> make throw on unrecognised property names.
>
> --Oliver
>
> On Aug 18, 2009, at 12:21 PM, Brian Barnes wrote:
>
>> Another quick suggestion, and this is obviously just another 
>> convenience method (I'm sure I could handle this by overriding):  
>> It'd be nice to be able to lock a class (it could be a flag on the 
>> definition) to make adding properties (outside the static variable 
>> and function list) illegal.
>>
>> For instance, I have a problem with my users misspelling a property, 
>> then not understanding why nothing happens.  In this case, they'd get 
>> an error.
>>
>> Basically, if you can't find a setter in my static lists, then toss 
>> an error.
>>
>> [>] Brian
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>



More information about the webkit-dev mailing list