MapTests.cs 388 B

123456789101112131415
  1. using Jint.Runtime;
  2. using Xunit;
  3. namespace Jint.Tests.Runtime
  4. {
  5. public class MapTests
  6. {
  7. [Fact]
  8. public void ShouldThrowWhenCalledWithoutNew()
  9. {
  10. var e = Assert.Throws<JavaScriptException>(() => new Engine().Execute("const m = new Map(); Map.call(m,[]);"));
  11. Assert.Equal("Constructor Map requires 'new'", e.Message);
  12. }
  13. }
  14. }