Last Comment Bug 425034 - Treehydra: Fix enumerator support
: Treehydra: Fix enumerator support
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Rewriting and Analysis (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: David Mandelin [:dmandelin]
:
: Michael Layzell [:mystor] [:mrl]
Mentors:
Depends on: 425066
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-25 11:18 PDT by David Mandelin [:dmandelin]
Modified: 2011-09-03 13:37 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Proposed patch (2.46 KB, patch)
2008-03-25 14:48 PDT, David Mandelin [:dmandelin]
no flags Details | Diff | Splinter Review
Revised patch (2.39 KB, patch)
2008-03-25 14:54 PDT, David Mandelin [:dmandelin]
no flags Details | Diff | Splinter Review
Handle __iterator__ special case in js (3.01 KB, patch)
2008-03-25 15:34 PDT, (dormant account)
no flags Details | Diff | Splinter Review

Description David Mandelin [:dmandelin] 2008-03-25 11:18:53 PDT
Enumerators work inconsistently in Treehydra. The problem is that the lazy property resolve function will produce an error the second time it is called, even though the property being resolved may actually be available further up the prototype chain.

The ideal fix would be one where the object throws an error if and only if a property that does not exist on any level of the prototype chain is asked for.
Comment 1 David Mandelin [:dmandelin] 2008-03-25 14:48:04 PDT
Created attachment 311658 [details] [diff] [review]
Proposed patch

Admittedly this is sort of hacky, but I think it works well and is the best we can do for now. A fix to bug 425066 will hopefully allow this to be simplified and definitively solve the problem.
Comment 2 David Mandelin [:dmandelin] 2008-03-25 14:54:04 PDT
Created attachment 311665 [details] [diff] [review]
Revised patch

I left a line of debugging code in the previous patch.
Comment 3 (dormant account) 2008-03-25 15:34:57 PDT
Created attachment 311677 [details] [diff] [review]
Handle __iterator__ special case in js

Dave,
how about this?
I think it's a little shorter and leaves room for further special-casing in the JS file if need be.
Comment 4 (dormant account) 2008-03-25 15:46:14 PDT
Committed my revised patch. Will wait on bug 425066 before closing this

Note You need to log in before you can comment on or make changes to this bug.