开发者

ScriptSharp: myObject.prototype = new myOtherObject;

How can I reproduce this in ScriptSharp (C#):

myObject = function(input) {

开发者_如何学Python}

myObject.prototype = new myOtherObject;


When you're using script# you're using the c# syntax to create classes, derive classes etc.

So simply define your class myObject and have it derive from your other class myOtherObject, and let the compiler and bootstrapper script (mscorlib.js) set up the inheritance at runtime.

The whole point is to have a natural OOP syntax, rather than work with a simulation by manually chaining prototypes.

Hope that helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜