diff --git a/src/libraries/Common/src/Interop/Browser/Interop.Runtime.cs b/src/libraries/Common/src/Interop/Browser/Interop.Runtime.cs
index b6ea05e7c7f879..deda2ad9de8e51 100644
--- a/src/libraries/Common/src/Interop/Browser/Interop.Runtime.cs
+++ b/src/libraries/Common/src/Interop/Browser/Interop.Runtime.cs
@@ -56,6 +56,9 @@ internal static partial class Runtime
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern void CancelPromiseRef(IntPtr promiseJSHandle, out int exceptionalResult, out string result);
+ [MethodImplAttribute(MethodImplOptions.InternalCall)]
+ internal static extern void DoNothing(out int exceptionalResult);
+
// /
// / Execute the provided string in the JavaScript context
// /
diff --git a/src/libraries/System.Private.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Runtime.cs b/src/libraries/System.Private.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Runtime.cs
index bb909a4d5e1694..e41feb90c90121 100644
--- a/src/libraries/System.Private.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Runtime.cs
+++ b/src/libraries/System.Private.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/Runtime.cs
@@ -3,6 +3,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
+using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace System.Runtime.InteropServices.JavaScript
@@ -12,6 +13,13 @@ public static partial class Runtime
private const string TaskGetResultName = "get_Result";
private static readonly MethodInfo _taskGetResultMethodInfo = typeof(Task<>).GetMethod(TaskGetResultName)!;
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public static int DoNothing()
+ {
+ Interop.Runtime.DoNothing(out int exception);
+ return exception;
+ }
+
///
/// Execute the provided string in the JavaScript context
///
diff --git a/src/libraries/System.Private.Runtime.InteropServices.JavaScript/tests/System.Private.Runtime.InteropServices.JavaScript.Tests.csproj b/src/libraries/System.Private.Runtime.InteropServices.JavaScript/tests/System.Private.Runtime.InteropServices.JavaScript.Tests.csproj
index 5bfcbdfe2a41e8..1d7b0f3beb4190 100644
--- a/src/libraries/System.Private.Runtime.InteropServices.JavaScript/tests/System.Private.Runtime.InteropServices.JavaScript.Tests.csproj
+++ b/src/libraries/System.Private.Runtime.InteropServices.JavaScript/tests/System.Private.Runtime.InteropServices.JavaScript.Tests.csproj
@@ -7,16 +7,6 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/src/libraries/System.Private.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/ArrayTests.cs b/src/libraries/System.Private.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/ArrayTests.cs
deleted file mode 100644
index ae247a1bb2f63c..00000000000000
--- a/src/libraries/System.Private.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/ArrayTests.cs
+++ /dev/null
@@ -1,173 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Collections.Generic;
-using Xunit;
-
-namespace System.Runtime.InteropServices.JavaScript.Tests
-{
- public static class ArrayTests
- {
- [Fact]
- public static void ArrayLength()
- {
- Array d = new Array();
- Assert.Equal(0, d.Length);
- }
-
- [Fact]
- public static void ArrayLength1()
- {
- Array d = new Array(50);
- Assert.Equal(50, d.Length);
- }
-
- [Fact]
- public static void Array_GetSetItem()
- {
- var jsArray = new Array(7, 8, 9, 10, 11, 12, 13);
- IList iList = new int[] { 7, 8, 9, 10, 11, 12, 13 };
-
- Assert.Equal(jsArray.Length, iList.Count);
- for (int i = 0; i < iList.Count; i++)
- {
- Assert.Equal(jsArray[i], iList[i]);
-
- iList[i] = 99;
- jsArray[i] = 99;
- Assert.Equal(99, iList[i]);
- Assert.Equal(99, jsArray[i]);
- }
- }
-
- [Fact]
- public static void Array_GetSetItemInvalid()
- {
- var jsArray = new Array(7, 8, 9, 10, 11, 12, 13);
- Assert.Null(jsArray[-1]);
- Assert.Null(jsArray[jsArray.Length]);
- Assert.Equal(0, jsArray[-1] = 0);
- Assert.Equal(0, jsArray[jsArray.Length] = 0);
- }
-
- [Fact]
- public static void Array_GetItemIndex()
- {
- var jsArray = new Array(7, 8, 9, 10, 11, 12, 13);
- Assert.Equal(7, jsArray[0]);
- Assert.Equal(8, jsArray[1]);
- Assert.Equal(9, jsArray[2]);
- Assert.Equal(10, jsArray[3]);
- Assert.Equal(11, jsArray[4]);
- Assert.Equal(12, jsArray[5]);
- Assert.Equal(13, jsArray[6]);
- }
-
- [Fact]
- public static void Array_GetSetItemIndex()
- {
- var jsArray = new Array(7, 8, 9, 10, 11, 12, 13);
- for (int d = 0; d < jsArray.Length; d++)
- {
- jsArray[d] = (int)jsArray[d] + 1;
- }
- Assert.Equal(8, jsArray[0]);
- Assert.Equal(9, jsArray[1]);
- Assert.Equal(10, jsArray[2]);
- Assert.Equal(11, jsArray[3]);
- Assert.Equal(12, jsArray[4]);
- Assert.Equal(13, jsArray[5]);
- Assert.Equal(14, jsArray[6]);
- }
-
- [Fact]
- public static void Array_Pop()
- {
- var jsArray = new Array(7, 8, 9, 10, 11, 12, 13);
- Assert.Equal(13, jsArray.Pop());
- Assert.Equal(12, jsArray.Pop());
- Assert.Equal(11, jsArray.Pop());
- Assert.Equal(10, jsArray.Pop());
- Assert.Equal(9, jsArray.Pop());
- Assert.Equal(8, jsArray.Pop());
- Assert.Equal(7, jsArray.Pop());
- Assert.Equal(0, jsArray.Length);
- }
-
- [Fact]
- public static void Array_PushPop()
- {
- var objArray = new object[] { "test7", "test8", "test9", "test10", "test11", "test12", "test13" };
- var jsArray = new Array();
- for (int d = 0; d < objArray.Length; d++)
- {
- jsArray.Push(objArray[d]);
- }
- Assert.Equal("test13", jsArray.Pop());
- Assert.Equal("test12", jsArray.Pop());
- Assert.Equal("test11", jsArray.Pop());
- Assert.Equal("test10", jsArray.Pop());
- Assert.Equal("test9", jsArray.Pop());
- Assert.Equal("test8", jsArray.Pop());
- Assert.Equal("test7", jsArray.Pop());
- Assert.Equal(0, jsArray.Length);
- }
-
- [Fact]
- public static void Array_PushShift()
- {
- var objArray = new object[] { "test7", "test8", "test9", "test10", "test11", "test12", "test13" };
- var jsArray = new Array();
- for (int d = 0; d < objArray.Length; d++)
- {
- jsArray.Push(objArray[d]);
- }
- Assert.Equal("test7", jsArray.Shift());
- Assert.Equal("test8", jsArray.Shift());
- Assert.Equal("test9", jsArray.Shift());
- Assert.Equal("test10", jsArray.Shift());
- Assert.Equal("test11", jsArray.Shift());
- Assert.Equal("test12", jsArray.Shift());
- Assert.Equal("test13", jsArray.Shift());
- Assert.Equal(0, jsArray.Length);
- }
-
- [Fact]
- public static void Array_UnShiftShift()
- {
- var objArray = new object[] { "test7", "test8", "test9", "test10", "test11", "test12", "test13" };
- var jsArray = new Array();
- for (int d = 0; d < objArray.Length; d++)
- {
- Assert.Equal(d + 1, jsArray.UnShift(objArray[d]));
- }
- Assert.Equal("test13", jsArray.Shift());
- Assert.Equal("test12", jsArray.Shift());
- Assert.Equal("test11", jsArray.Shift());
- Assert.Equal("test10", jsArray.Shift());
- Assert.Equal("test9", jsArray.Shift());
- Assert.Equal("test8", jsArray.Shift());
- Assert.Equal("test7", jsArray.Shift());
- Assert.Equal(0, jsArray.Length);
- }
-
- [Fact]
- public static void Array_IndexOf()
- {
- var beasts = new Array("ant", "bison", "camel", "duck", "bison");
- Assert.Equal(1, beasts.IndexOf("bison"));
- Assert.Equal(4, beasts.IndexOf("bison", 2));
- Assert.Equal(-1, beasts.IndexOf("giraffe"));
- }
-
- [Fact]
- public static void Array_LastIndexOf()
- {
- var beasts = new Array("Dodo", "Tiger", "Penguin", "Dodo");
- Assert.Equal(3, beasts.LastIndexOf("Dodo"));
- Assert.Equal(1, beasts.LastIndexOf("Tiger"));
- Assert.Equal(0, beasts.LastIndexOf("Dodo", 2)); // The array is searched backwards
- Assert.Equal(-1, beasts.LastIndexOf("giraffe"));
- }
- }
-}
diff --git a/src/libraries/System.Private.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/DataViewTests.cs b/src/libraries/System.Private.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/DataViewTests.cs
deleted file mode 100644
index 4e06bf20f005a1..00000000000000
--- a/src/libraries/System.Private.Runtime.InteropServices.JavaScript/tests/System/Runtime/InteropServices/JavaScript/DataViewTests.cs
+++ /dev/null
@@ -1,134 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.Collections.Generic;
-using Xunit;
-
-namespace System.Runtime.InteropServices.JavaScript.Tests
-{
- public static class DataViewTests
- {
- [Fact]
- public static void DataViewConstructor()
- {
- // create an ArrayBuffer with a size in bytes
- var buffer = new ArrayBuffer(16);
-
- // Create a couple of views
- var view1 = new DataView(buffer);
- var view2 = new DataView(buffer, 12, 4); //from byte 12 for the next 4 bytes
- view1.SetInt8(12, 42); // put 42 in slot 12
-
- Assert.Equal(42, view2.GetInt8(0));
- }
-
- public static IEnumerable