mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-02 12:32:55 +00:00

Rhino: behavior update for IdScriptable subclasses Date: Fri, 18 May 2001 11:45:00 +0200 From: Igor Bukanov <igor.bukanov@windriver.com> Organization: Wind River To: Norris Boyd <nboyd@atg.com> The attached patch introduces separation between id-base properties in prototype instances and the rest of objects so it is possible to allocate some ids for each instance and the rest only for prototype. The patch adds to each descendants of IdScriptable a special prototypeFlag which set to true only if object serves as a global prototype and all methods that check/return ids first check for that flag. (This is the reason for the patch size: diff is not very well in dealing with indentation changes.) In this way ids for prototype properties are completely hidden from potential subclasses and there is no need to define methods like getMaximumId in most cases, only if some ids present in each instance, IdScriptable.maxInstanceId should be overridden to return max id present in each instance. The patch also replaces 2 boolean fields in IdScriptable by bit masks in the setupFlag field.