This repository has been archived by the owner on Aug 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #874 from iskiselev/Misc_Reflection
Misc reflection
- Loading branch information
Showing
40 changed files
with
747 additions
and
108 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
7 changes: 0 additions & 7 deletions
7
JSIL.Libraries/Includes/Core/Reflection/Classes/System.Attribute.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,2 @@ | ||
JSIL.ImplementExternals("System.Attribute", function ($) { | ||
$.Method({ Static: true, Public: true }, "GetCustomAttribute", | ||
(new JSIL.MethodSignature($jsilcore.TypeRef("System.Attribute"), [$jsilcore.TypeRef("System.Reflection.Assembly"), $jsilcore.TypeRef("System.Type")], [])), | ||
function GetCustomAttribute(assembly, attributeType) { | ||
// FIXME: Not implemented | ||
return null; | ||
} | ||
); | ||
}); |
This file contains 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
This file contains 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
This file contains 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
17 changes: 0 additions & 17 deletions
17
JSIL.Libraries/Includes/Core/Reflection/Classes/System.Reflection.ParameterInfo.js
This file contains 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
2 changes: 2 additions & 0 deletions
2
JSIL.Libraries/Includes/Core/Reflection/Classes/System.Reflection.RuntimeConstructorInfo.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
JSIL.MakeClass("System.Reflection.ConstructorInfo", "System.Reflection.RuntimeConstructorInfo", false, [], function ($) { | ||
}); |
2 changes: 2 additions & 0 deletions
2
JSIL.Libraries/Includes/Core/Reflection/Classes/System.Reflection.RuntimeEventInfo.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
JSIL.MakeClass("System.Reflection.EventInfo", "System.Reflection.RuntimeEventInfo", false, [], function ($) { | ||
}); |
2 changes: 2 additions & 0 deletions
2
JSIL.Libraries/Includes/Core/Reflection/Classes/System.Reflection.RuntimeFieldInfo.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
JSIL.MakeClass("System.Reflection.FieldInfo", "System.Reflection.RuntimeFieldInfo", false, [], function ($) { | ||
}); |
22 changes: 22 additions & 0 deletions
22
JSIL.Libraries/Includes/Core/Reflection/Classes/System.Reflection.RuntimeMethodInfo.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
JSIL.MakeClass("System.Reflection.MethodInfo", "System.Reflection.RuntimeMethodInfo", false, [], function ($) { | ||
$.Method({ Static: false, Public: false }, "GetParentDefinition", | ||
(new JSIL.MethodSignature($jsilcore.TypeRef("System.Reflection.RuntimeMethodInfo"), [], [])), | ||
function get_ReturnType() { | ||
if (!this._descriptor.Virtual || this._descriptor.Static) { | ||
return null; | ||
} | ||
|
||
var currentType = this.get_DeclaringType(); | ||
while (true) { | ||
currentType = currentType.__BaseType__; | ||
if (!(currentType && currentType.GetType)) { | ||
return null; | ||
} | ||
var foundMethod = JSIL.GetMethodInfo(currentType.__PublicInterface__, this.get_Name(), this._data.signature, false, null); | ||
if (foundMethod != null) { | ||
return foundMethod; | ||
} | ||
} | ||
} | ||
); | ||
}); |
18 changes: 18 additions & 0 deletions
18
JSIL.Libraries/Includes/Core/Reflection/Classes/System.Reflection.RuntimeParameterInfo.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
JSIL.MakeClass("System.Reflection.ParameterInfo", "System.Reflection.RuntimeParameterInfo", false, [], function ($) { | ||
$.RawMethod(false, "$fromArgumentTypeAndPosition", function (argumentType, position) { | ||
this.argumentType = argumentType; | ||
this.position = position; | ||
this._name = null; | ||
this.__Attributes__ = []; | ||
}); | ||
|
||
$.RawMethod(false, "$populateWithParameterInfo", function (parameterInfo) { | ||
this._name = parameterInfo.name || null; | ||
|
||
if (parameterInfo.attributes) { | ||
var mb = new JSIL.MemberBuilder(null); | ||
parameterInfo.attributes(mb); | ||
this.__Attributes__ = mb.attributes; | ||
} | ||
}); | ||
}); |
2 changes: 2 additions & 0 deletions
2
JSIL.Libraries/Includes/Core/Reflection/Classes/System.Reflection.RuntimePropertyInfo.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
JSIL.MakeClass("System.Reflection.PropertyInfo", "System.Reflection.RuntimePropertyInfo", false, [], function ($) { | ||
}); |
10 changes: 10 additions & 0 deletions
10
JSIL.Libraries/Includes/Core/Reflection/Classes/System.RuntimeType.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
JSIL.MakeClass("System.Reflection.TypeInfo", "System.RuntimeType", false, [], function ($) { | ||
$jsilcore.RuntimeTypeInitialized = true; | ||
|
||
$.Method({ Public: true, Static: true }, "op_Equality", | ||
new JSIL.MethodSignature($.Boolean, [$.Type, $.Type]), | ||
function(lhs, rhs) { | ||
if (lhs === rhs) | ||
return true; | ||
|
||
return String(lhs) == String(rhs); | ||
} | ||
); | ||
}); |
Oops, something went wrong.