JavaScript 对象继承模型:Fiber.js

yn6e 9年前

Fiber.js 是来自 Linkedin 的一个轻量级的 JavaScript 对象继承模型。

示例代码:

// Animal base class  var Animal = Fiber.extend(function() {      return {          // The `init` method serves as the constructor.          init: function() {              // Private              function private1(){}              function private2(){}                 // Privileged              this.privileged1 = function(){}              this.privileged2 = function(){}          },          // Public          method1: function(){}      }  });     var animal = new Animal(); // Create a new Animal instance

项目主页:http://www.open-open.com/lib/view/home/1431224065033