GNOME Bugzilla – Bug 649624
gi: Don't throw in JSResolveOp
Last modified: 2011-05-16 23:07:30 UTC
This broke the looking glass in the shell. Come on man, 'in' should throw an exception!
Created attachment 187403 [details] [review] gi: Don't throw in JSResolveOp Not only is it extremely inpolite, it broke things like "hasOwnProperty" and the "in" operator that depended on the return value of it.
We've been doing this since the dawn of time; Fri Oct 10 21:37:39 2008 +0000 to be precise. Can you give example code that is broken by this? Is it "for (var x in Gtk)" ?
gnome-shell's environment.js replaces toString with something that does: if ('actor' in this) Well, the 'in' operator calls the JSResolveOp so it can look up whether the object has something, and oops, an exception was thrown!
Review of attachment 187403 [details] [review]: Looks good.
(In reply to comment #3) > gnome-shell's environment.js replaces toString with something that does: > > if ('actor' in this) > > Well, the 'in' operator calls the JSResolveOp so it can look up whether the > object has something, and oops, an exception was thrown! Makes sense, I just like to have explicit examples of what's broken (feel free to add that to the commit message too).
Attachment 187403 [details] pushed as ae4d4bc - gi: Don't throw in JSResolveOp