Well, you can just redefine MyClass to a different constructor function:

MyClass = function() {
    ...
}

You'll probably also want to set
   MyClass.prototype= ...
to point to your newly created objects' desired prototype.

HTH,
   Attila.

On 2007.12.03., at 17:55, [EMAIL PROTECTED] wrote:

> Hi.
>
> Is there any way I could substitute Java instance returned from
> constructor inside Rhino script? For example, when I write this in
> script: var object = new MyClass(); I'd like to have my interceptor be
> called which will return new example of MyClass.
>
> I need it to be able to create some dynamic objects (proxy, for
> example) which aren't known at design time. Is it possible in Rhino at
> all (maybe in different way)?
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to