This project is read-only.
1

Resolved

Implicit support for System.Int64 and System.Decimal

description

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.

comments

oliverbock wrote May 15, 2012 at 1: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 10: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 1: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 1:54 AM

gurksaft wrote May 22, 2012 at 3:56 PM

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

oliverbock wrote May 22, 2012 at 11:06 PM

Yes. Please check it out via Subversion.

wrote Feb 22, 2013 at 12:54 AM

wrote May 16, 2013 at 12:17 PM

wrote May 16, 2013 at 12:17 PM

wrote Jun 14, 2013 at 8:28 AM