Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A tiny yet powerful lib for creating extensible JS Classes.

License

NotificationsYou must be signed in to change notification settings

duzun/classifyed.js

Repository files navigation

A tiny yet powerful lib to create extensible JS Classes,with an elegant way of calling parent methods.

Usage

varMyClass=Classifyed.extend({constructor:function(){ ...},doFoo:function(){ ...}},{type:'MyClass',staticFoo:function(){// This is a static method}});varSuperClass=MyClass.extend({constructor:function(){this.__super__('constructor',arguments);// call parent constructor// Continue with the constructor...},doFoo:function(){this.__super__('doFoo',arguments);// call parent method// Do stuff}},{type:'SuperClass',staticFoo:function(){this.__super__.constructor.staticFoo();// call parent static methodthis.parent().staticFoo();// same as previous}});varmyObj=newSuperClass();myObj.doFoo();myObj.__super__('doFoo');console.log(myObj.constructor.type);// 'MyClass'console.log(myObj.constructor.__super__.constructor.type);// 'SuperClass'console.log(myObj.constructor.parent().type);// 'SuperClass' again

About

A tiny yet powerful lib for creating extensible JS Classes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp