Created
May 8, 2011 08:31
-
-
Save kg/961222 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSIL.MakeType = function (baseType, namespace, localName, fullName, isReferenceType) { | |
if (typeof (namespace[localName]) != "undefined") | |
throw new Error("Duplicate definition of type " + fullName); | |
var initType; | |
var ctor = function () { | |
JSIL.InitializeStructFields(this, localName); | |
if (typeof (initType) != "undefined") | |
initType(); | |
try { | |
if (typeof (this._ctor) != "undefined") | |
this._ctor.apply(this, arguments); | |
} catch (e) { | |
if (JSIL.CheckType(e, JSIL.MissingOverloadException) && (arguments.length == 0)) | |
return; | |
else | |
throw e; | |
} | |
}; | |
ctor.prototype = JSIL.MakeProto(baseType, fullName, false); | |
ctor.prototype.__ShortName__ = localName; | |
ctor.toString = function () { | |
return "<Type " + fullName + ">"; | |
}; | |
ctor.Of = function (T) { | |
return ctor; | |
}; | |
ctor.__IsReferenceType__ = isReferenceType; | |
ctor.__TypeInitialized__ = false; | |
ctor.__LockCount__ = 0; | |
ctor.__FullName__ = fullName; | |
initType = function () { | |
JSIL.InitializeType(ctor); | |
}; | |
namespace[localName] = ctor; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment