From cf2187b0463df38c12ea5b4bcc22c18b4ccc50a0 Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Tue, 12 Jul 2022 14:16:14 +0200 Subject: [PATCH] [wasm] mark JSImportGenerator C# only #72007 - mark JSImportGenerator C# only - Viktor's feedback - put back lost method GetCSOwnedObjectJSHandleRef --- .../JSImportGenerator.csproj | 1 + ....Runtime.InteropServices.JavaScript.csproj | 21 ++++++++----------- .../JavaScript/Interop/JavaScriptExports.cs | 12 +++++++++++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.csproj index 8976ddfdab3..5d5606d9e3c 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSImportGenerator.csproj @@ -21,6 +21,7 @@ JSImportGenerator, analyzers true $(DefineConstants);JSIMPORTGENERATOR + cs diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj index 0f1d6e8058e..e9c87d02955 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj @@ -3,7 +3,6 @@ $(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent) true enable - @@ -12,15 +11,6 @@ SR.SystemRuntimeInteropServicesJavaScript_PlatformNotSupported - - - - - - - - - @@ -70,9 +60,16 @@ - + + + + + + + + - + diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptExports.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptExports.cs index 619dec1a5f3..ea24f8e1bf7 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptExports.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Interop/JavaScriptExports.cs @@ -31,6 +31,18 @@ public static void GetCSOwnedObjectByJSHandleRef(IntPtr jsHandle, int shouldAddI result = null; } + [MethodImplAttribute(MethodImplOptions.NoInlining)] // https://github.com/dotnet/runtime/issues/71425 + public static IntPtr GetCSOwnedObjectJSHandleRef(in JSObject jsObject, int shouldAddInflight) + { + jsObject.AssertNotDisposed(); + + if (shouldAddInflight != 0) + { + jsObject.AddInFlight(); + } + return jsObject.JSHandle; + } + [MethodImplAttribute(MethodImplOptions.NoInlining)] // https://github.com/dotnet/runtime/issues/71425 public static IntPtr TryGetCSOwnedObjectJSHandleRef(in object rawObj, int shouldAddInflight) { -- GitLab