ECMA-357 aside (oh the horror)

On Fri, Feb 10, 2012 at 4:24 AM, Andreas Rossberg <[email protected]>wrote:

> Short answer: you cannot and you should not. It's fundamental to the
> design of the JavaScript language that "methods" are just ordinary
> properties (that happen to be functions), and are accessed in a
> uniform manner.
>
> /Andreas
>
>
> On 10 February 2012 06:26, Omkar Kulkarni <[email protected]> wrote:
> > Anybody?
> >
> > On Jan 1, 9:00 pm, Omkar Kulkarni <[email protected]> wrote:
> >> I have a javascript object 'myObject' to which I have attached
> >> interceptors. I can access its properties in two ways:
> >>
> >> myObject.myProperty             OR      myObject.myProperty ( )
> >>
> >> Both shall invoke the 'Get' interceptor in C++. Is there a way to
> >> differentiate between the two from within the interceptor?
> >>
> >> Handle<Value> myInterceptor(Local<String> name, const AccessorInfo&
> >> info)
> >> {
> >>         if( the property is being read )
> >>                 return a string;
> >>         else if( the property is being called )
> >>                 return a function;
> >>
> >> }
> >>
> >> Appreciate the help. Thanks!
> >
> > --
> > v8-users mailing list
> > [email protected]
> > http://groups.google.com/group/v8-users
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to