is it possible to create object the following two style with same name
var user = Client.User // Client->User will be create default construct
var user = Client.User(2) // Client->User will be create with id ( pass id
to construct )
i am trying to the following way..
<code>
Object.defineProperty(Client, "User", {
get: function get( ) {
fn = function UserModel( id ) {
return new User( id )
}
return fn;
},
enumerable: true
});
</code>
it's work
Client.User(2)
-------
but it does not work, it's return UserModel function instead of User object
Client.User
is there any way to create object like that style with same name ?
Thanks
--
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.