We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4e3cb5 commit 823e2c1Copy full SHA for 823e2c1
Tests/Noesis.Javascript.Tests/InstanceOfTest.cs
@@ -54,5 +54,13 @@ public void UnregisteredObjectInstanceOfTest()
54
_context.Invoking(x => x.Run("test instanceof Test"))
55
.ShouldThrow<JavascriptException>().WithMessage("ReferenceError: Test is not defined");
56
}
57
+
58
+ [TestMethod]
59
+ public void ExtensionMethodIsPossible()
60
+ {
61
+ _context.SetConstructor("Test", typeof(TestClass), new Func<TestClass>(() => new TestClass()));
62
+ _context.Run("Test.prototype.fooDuplicated = function() { return this.foo * 2; }");
63
+ _context.Run("let x = new Test(); x.foo = 4; x.fooDuplicated() == 8").Should().Be(true);
64
+ }
65
66
0 commit comments