From a23d413a73ebc1b7e4eced30e66c4e4b5e8bc52d Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Mon, 7 Mar 2011 23:13:06 -0500 Subject: [PATCH] Updated README and TODO with visibility status --- README.md | 24 ++++++++++++------------ TODO | 7 +++---- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index d51aa15..264cdb9 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Current support includes: * Classical inheritance * Abstract classes and methods * Interfaces -* Near-completed visibility support in `visibility/master` branch +* Visibility support (public, protected and private members) **This project is still under development.** @@ -41,12 +41,12 @@ class. The constructor is provided as the `__construct()` method (influenced by { foo: '', - __construct: function( foo ) + 'public __construct': function( foo ) { this.foo = foo; }, - someMethod: function() + 'public someMethod': function() { console.log( 'someMethod() called' ); }, @@ -78,7 +78,7 @@ planned features and should be available shortly.** var SubFoo = Foo.extend( { - anotherMethod: function() + 'public anotherMethod': function() { }, }); @@ -87,7 +87,7 @@ planned features and should be available shortly.** // the same effect as above, even if Foo was created using Class.extend()) var SubFoo = Class.extend( Foo, { - anotherMethod: function() + 'public anotherMethod': function() { }, }); @@ -103,10 +103,10 @@ they contain one or more abstract methods. { // a function may be provided if you wish the subtypes to implement a // certain number of arguments - 'abstract fooBar': [ 'arg' ], + 'abstract public fooBar': [ 'arg' ], // alternatively, you needn't supply implementation details - 'abstract fooBar2': [], + 'abstract public fooBar2': [], }); If the abstract method provides implementation details (as shown by @@ -122,11 +122,11 @@ be considered abstract. // abstract methods var ConcreteFoo = AbstractFoo.extend( { - fooBar: function( arg ) + 'public fooBar': function( arg ) { }, - fooBar2: function() + 'public fooBar2': function() { }, }); @@ -134,7 +134,7 @@ be considered abstract. // cannot be instantiated because one abstract method remains var StillAbstractFoo = AbstractFoo.extend( { - fooBar: function( arg ) + 'public fooBar': function( arg ) { }, }); @@ -155,14 +155,14 @@ an interface must be declared as abstract. var MyType = Interface( { - 'abstract foo': [] + 'abstract public foo': [] }); To implement an interface, use the `implement()` class method: var ConcreteType = Class.implement( MyType ).extend( { - foo: function() {} + 'public foo': function() {} }); diff --git a/TODO b/TODO index edf128d..60c58ad 100644 --- a/TODO +++ b/TODO @@ -14,15 +14,14 @@ Misc cannot be used (# is not a valid token) - Class module is becoming too large; refactor -Property Keywords +Member Keywords - Restrictions; throw exceptions when unknown keywords are used - - public (default) - - private; 'this' will contain private members of self, but not private - members of parents - const; immutable properties - final; methods cannot be overridden by subtypes - static; method/property accessible via class definition - event; designates a supported event + - Concrete types must implement member with same visibility, or greater + visibility, than the abstract implementation defined Typing - Support JSDoc-style type definitions for parameters