diff --git a/test/JavaScriptEngineSwitcher.Tests/ChakraCore/InteropTests.cs b/test/JavaScriptEngineSwitcher.Tests/ChakraCore/InteropTests.cs index 95c72e86..8eebb27c 100644 --- a/test/JavaScriptEngineSwitcher.Tests/ChakraCore/InteropTests.cs +++ b/test/JavaScriptEngineSwitcher.Tests/ChakraCore/InteropTests.cs @@ -1,4 +1,7 @@ -namespace JavaScriptEngineSwitcher.Tests.ChakraCore +using System; +using Xunit; + +namespace JavaScriptEngineSwitcher.Tests.ChakraCore { public class InteropTests : InteropTestsBase { @@ -6,5 +9,26 @@ protected override string EngineName { get { return "ChakraCoreJsEngine"; } } + + [Fact] + public void EmbeddedInstanceOfDelegateHasFunctionPrototype() + { + // Arrange + var someFunc = new Func(() => 42); + + const string input = "Object.getPrototypeOf(embeddedFunc) === Function.prototype"; + + // Act + bool output; + + using (var jsEngine = CreateJsEngine()) + { + jsEngine.EmbedHostObject("embeddedFunc", someFunc); + output = jsEngine.Evaluate(input); + } + + // Assert + Assert.True(output); + } } } \ No newline at end of file