Permalink
Browse files

Fix null reference exception when calling GetMethod/GetMethods on a Type

Implement DirectoryInfo.Create
Fix InitResizableArray breaking some of the container type implementations
  • Loading branch information...
1 parent 7ff2b28 commit d2dd9c4ad71e284c657e667249a66b8db04a839d @kg kg committed Jul 5, 2012
Showing with 7 additions and 3 deletions.
  1. +1 −1 Libraries/JSIL.Bootstrap.js
  2. +3 −0 Libraries/JSIL.Core.js
  3. +3 −2 Libraries/JSIL.IO.js
@@ -1243,7 +1243,7 @@ JSIL.MakeClass("System.Object", "System.Threading.Thread", true, [], function ($
});
$jsilcore.InitResizableArray = function (target, elementType, initialSize) {
- target._items = new Array(initialSize);
+ target._items = new Array();
};
$jsilcore.$ListExternals = function ($, T, type) {
View
@@ -2492,6 +2492,9 @@ JSIL.$MakeMethodGroup = function (target, typeName, renamedMethods, methodName,
};
JSIL.$ApplyMemberHiding = function (typeObject, memberList, resolveContext) {
+ if (memberList.length < 1)
+ return;
+
// This is called during type system initialization, so we can't rely on any of MemberInfo's
// properties or methods - we need to access the data members directly.
View
@@ -942,14 +942,15 @@ JSIL.ImplementExternals("System.IO.DirectoryInfo", function ($) {
$.Method({Static:false, Public:true }, "Create",
(new JSIL.MethodSignature(null, [], [])),
function Create () {
- throw new Error('Not implemented');
+ System.IO.Directory.CreateDirectory(this._path);
}
);
$.Method({Static:false, Public:true }, "Create",
(new JSIL.MethodSignature(null, [$jsilcore.TypeRef("System.Security.AccessControl.DirectorySecurity")], [])),
function Create (directorySecurity) {
- throw new Error('Not implemented');
+ // FIXME: directorySecurity
+ System.IO.Directory.CreateDirectory(this._path);
}
);

0 comments on commit d2dd9c4

Please sign in to comment.