From 83672d3bab93e797e5c09644079ebd33e95db9d9 Mon Sep 17 00:00:00 2001 From: ik Date: Fri, 18 Sep 2015 20:28:28 -0700 Subject: [PATCH] Use mono formatters for non-integer types. Added BitConverter.DoubleToInt64Bits. --- .../Includes/Bootstrap/Core/Classes/System.BitConverter.js | 7 +++++++ Proxies/Numbers.cs | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/JSIL.Libraries/Includes/Bootstrap/Core/Classes/System.BitConverter.js b/JSIL.Libraries/Includes/Bootstrap/Core/Classes/System.BitConverter.js index 7ad90c2aa..d2bde21e8 100644 --- a/JSIL.Libraries/Includes/Bootstrap/Core/Classes/System.BitConverter.js +++ b/JSIL.Libraries/Includes/Bootstrap/Core/Classes/System.BitConverter.js @@ -301,6 +301,13 @@ JSIL.ImplementExternals("System.BitConverter", function ($) { (new JSIL.MethodSignature($.Double, [$jsilcore.TypeRef("System.Array", [$.Byte]), $.Int32], [])), $jsilcore.BytesToDouble ); + + $.Method({ Static: true, Public: true }, "DoubleToInt64Bits", + (new JSIL.MethodSignature($.Int64, [$.Double], [])), + function DoubleToInt64Bits(double) { + return $jsilcore.BytesToInt64($jsilcore.BytesFromDouble(double), 0); + } + ); }); //? if ('GENERATE_STUBS' in __out) { diff --git a/Proxies/Numbers.cs b/Proxies/Numbers.cs index 1253aabf0..f026d0140 100644 --- a/Proxies/Numbers.cs +++ b/Proxies/Numbers.cs @@ -52,12 +52,12 @@ public string ToString () { throw new InvalidOperationException(); } - [JSReplacement("JSIL.NumberToFormattedString($this, null, $format)")] + [JSReplacement("$typeof(this).__PublicInterface__.$$ToString($this, $format, null)")] public string ToString (string format) { throw new InvalidOperationException(); } - [JSReplacement("JSIL.NumberToFormattedString($this, null, $format, $formatProvider)")] + [JSReplacement("$typeof(this).__PublicInterface__.$$ToString($this, $format, $formatProvider)")] public string ToString (string format, IFormatProvider formatProvider) { throw new InvalidOperationException(); }