https://bugzilla.mozilla.org/show_bug.cgi?id=513369
I'd be happy to get some feedback regarding implementation details
such as naming, general design etc. It's the first time I'm writing
annotation classes, so I may have made some beginners mistakes.
Hannes
http://github.com/hns/helma-ng/blob/88ef182f47abbc8df7a1aef0ce60e82bc8e010da/src/org/helma/wrappers/ByteArray.java
http://github.com/hns/helma-ng/blob/88ef182f47abbc8df7a1aef0ce60e82bc8e010da/src/org/helma/wrappers/IOStream.java
Hannes
What I don't get his the proper way to handle the prototype for a class.
(Try and find the class prototype, or grab Object prototype) doesn't
seam right.
--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
The prototype is still created using the zero-args constructor of the
class. I haven't changed anything in that regard, the general
procedure is still the one described here:
(BTW, this feature needs documentation, and the API doc for
ScriptableObject.defineClass is one place where it should be
documented, the other one is http://www.mozilla.org/rhino/tutorial.html#javaScriptHostObjects)
If you want to customize prototype/constructor/scope setup, the best
thing is to implement finishInit() as described in the API docs above.
For example, in my CommonJS Binary/B host class, I only set up the
abstract Binary base class in the automatic defineClass, and then
create the ByteArray and ByteString classes in finishInit.
http://github.com/hns/helma-ng/blob/master/src/org/helma/wrappers/Binary.java#L121
Hannes
>
> Hannes Wallnoefer wrote:
> > I've started rewriting Helma NG host objects to the new annotation
> > based format, and it's looking and feeling quite good:
>
> >http://github.com/hns/helma-ng/blob/88ef182f47abbc8df7a1aef0ce60e82bc...
> >http://github.com/hns/helma-ng/blob/88ef182f47abbc8df7a1aef0ce60e82bc...