Implicit support for System.Int64 and System.Decimal


System.Int64 and System.Decimal is not treated as "number" type when returning values from .NET to V8, which System.Int32, System.Float and System.Double currently is.
public int a { get { return 1; } }
public long b { get { return 1; } }
public float c { get { return 1.0f; } }
public double d { get { return 1.0; } }
public decimal e { get { return 1.0M; } }
Properties [a], [c] and [d] will have typeof() set as "number" while [b] and [e] will have typeof() set as "object" (native .NET object); valueOf() will fail for [b] and [e]. Methods requiring System.Int64 and System.Decimal as arguments will have a argument mismatch when calling from V8.
Perhaps implicit support for both types, V8->.NET and .NET->V8.
One situation is where file offsets is required. Using Int32 will remove support for large files while Int64 will cause casting/conversion to be required at all methods using the type.


oliverbock wrote May 15, 2012 at 12:35 AM

All simple value types except decimal are now supported in the code in Subversion, although a release containing them has not been made. If you want me to support decimal as well then you will need to work out what the managed CLR C++ type matching C#'s decimal is, because I cannot!

gurksaft wrote May 21, 2012 at 9:05 PM

"decimal" is just an alias for "System.Decimal" which is the equivalent of "System::Decimal" in C++. I do not use the decimal that often so for me it is not important at the moment. Int64 should suffice for now. Thanks. :-)

oliverbock wrote May 22, 2012 at 12:03 AM

Thanks. I was looking for some "proper" C type (e.g. unsigned long long = System.UInt64), but System::Decimal works too (or at least compiles). Committed.

wrote May 22, 2012 at 12:54 AM

gurksaft wrote May 22, 2012 at 2:56 PM

Excellent. I assume you have added support for System.Byte too?

oliverbock wrote May 22, 2012 at 10:06 PM

Yes. Please check it out via Subversion.

wrote Feb 21, 2013 at 11:54 PM

wrote May 16, 2013 at 11:17 AM

wrote May 16, 2013 at 11:17 AM

wrote Jun 14, 2013 at 7:28 AM