james.su at gmail.com
Fri Mar 6 17:52:55 PST 2009
Thanks for your reply.
On Sat, Mar 7, 2009 at 7:41 AM, Geoffrey Garen <ggaren at apple.com> wrote:
> Hi Zhe.
>> customized global object (by providing a special class when creating the
>> context). My customized global object provides some built-in properties that
>> object by using variable declaraction statement. For example, assuming the
>> global object has a built-in property, named "foo", a "var foo;" statement
>> "var foo;" statement, the built-in foo shall be able to get and set from
>> HasProperty, GetProperty, SetProperty callbacks of a class definition) can't
>> distinguish variable delcaration statement and variable assigment statement.
>> I checked SpiderMonkey's API and found it can distinguish such things by
>> providing a flag when calling ResolveProperty callback.
> I'm surprised to hear that SpiderMonkey's property setting API includes a
> flag distinguishing var declarations from other kinds of property setting.
> Internet Explorer supports shadowing global properties with var
> declarations, but Firefox does not. (Perhaps you're thinking of the
> SpiderMonkey flag to distinguish "x = y" syntax from "this.x = y" syntax,
> which is slightly different.)
SpiderMonkey can distinguish among many different type of statements. See
> It may not be my place, but I would discourage you from giving var
> declarations a special behavior, distinct from their behavior on the web.
> programmers understand how it works, due to their experience with the web.
I also don't want to support such non-standard behavior, however we need
behavior. What a pity. Anyway, thanks for your reply.
> Do you have any idea on this issue? How can I implement such behavior
>> based on current API?
> other property setting. I'm not sure how you would implement that.
too simple to achieve some feature, comparing to SpiderMonkey, which is too
complex and flexible.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev