Skip to content

Commit

Permalink
Merge pull request #5 from wizard04wsu/access-modifiers
Browse files Browse the repository at this point in the history
small changes
  • Loading branch information
wizard04wsu authored Nov 20, 2019
2 parents 48f53a7 + cfb8bd4 commit f0bf3be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ s.whatAmI(); //I am a rectangle. I am a square.

### Protected members

Additionally, a class can give its descendants protected access to its private variables. Once <code>*Super*()</code> is called within the constructor, the protected properties of its parent class are made available via <code>*Super*.protected</code>. This object will be available to child classes as well; any additions to or deletions of its members that are made here in the constructor will be reflected in the class' descendants.
Additionally, a class can give its descendants protected access to its private variables. Once <code>*Super*()</code> is called within the constructor, the protected properties of its parent class are made available via <code>*Super*.protected</code>. This object will be available to child classes as well; any additions/deletions/overloads of its members that are made here in the constructor will be reflected in the class' descendants.

#### Example

Expand Down
2 changes: 1 addition & 1 deletion src/Class.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
$constructorFn.apply(newInstance, [superFn].concat([].slice.call(arguments))); //(This way it doesn't create another new function every time a constructor is run.)

if(!superFnCalled && !$warnedAboutSuper){
warn(newClass.name+" constructor does not call Super()");
warn(newClass.name+" instance is not initialized by its parent class");
$warnedAboutSuper = true; //prevent multiple warnings about the same issue
}

Expand Down

0 comments on commit f0bf3be

Please sign in to comment.