1

Closed

How support import?

description

var list = new System.Collections.Generic.List{System.Int32}(5);
list.Add(1);
list.Add(15);
for(var i in list)
{
show(i);
}

It's long....
Closed Oct 3, 2014 at 6:43 PM by sebastienros
Jint has been rewritten and this issue should be fixed in the new version. Please check it on https://github.com/sebastienros/jint or on using the nuget package here: https://www.nuget.org/packages/Jint/

comments

aloner wrote Jun 25, 2011 at 3:04 PM

The 'delete' keyword is not work in a var?

var x = 1;
delete x;

throw Exception.

cin wrote Jun 29, 2011 at 7:25 PM

There are can be a little trick

var hash_t = System.Collections.Hashtable;
var hash = new hash_t();

But it doesn't work with generics, but you can specialize a generic in the native code, and it will be marshalled as a constructor

var list_int_t = MyTypeHelperClass.ListOfInt;

where

public class MyTypeHelperClass {
public static Type ListOfInt {
    get { return typeof(List<int>); }
}
}

or something like this way