Change 41967 by [EMAIL PROTECTED] on 2006/05/02 06:18:25 *pending*
Summary: Tweak Class.make syntax
Technical Reviewer: jgrandy (pending)
QA Reviewer: max (pending)
Doc Reviewer: hqm (pending)
Details:
Change the arguments to Class.make from the current prototype
to:
Class.make(identifier:String,
inheritance:(Class || Array),
initValues:Object)
When inheritance is an array, it is a list of traits and the
superclass (in order of precedence from most to least).
This will make our syntax look closer to JS2. So you might
say:
MyClass = Class.make('MyClass', null, {
myAttr: 42,
myMethod: function () { ... },
...});
You can still write things out longhand if you like:
MyClass = Class.make('MyClass');
MyClass.addProperty('myAttr', 42);
MyClass.addProperty('myMethod', function () { ... });
Tests: instances, test, testfive.
Affected files ...
... //depot/sandbox/ptw/classes/class.js#6 edit
... //depot/sandbox/ptw/classes/instances.js#1 edit
... //depot/sandbox/ptw/classes/test.js#2 edit
... //depot/sandbox/ptw/classes/testfive.js#1 edit
[I will check this in so you can review 'in situ']
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev