|
@@ -1,3 +1,4 @@
|
|
|
|
+using System;
|
|
using Xunit;
|
|
using Xunit;
|
|
|
|
|
|
namespace Jint.Tests.Runtime
|
|
namespace Jint.Tests.Runtime
|
|
@@ -13,5 +14,31 @@ namespace Jint.Tests.Runtime
|
|
Assert.Equal("a, 1, a, {\"0\":\"a\",\"1\":1,\"2\":\"a\"}", e.Execute("testFunc('a', 1, 'a');").GetCompletionValue().AsString());
|
|
Assert.Equal("a, 1, a, {\"0\":\"a\",\"1\":1,\"2\":\"a\"}", e.Execute("testFunc('a', 1, 'a');").GetCompletionValue().AsString());
|
|
Assert.Equal("a, 1, a, {\"0\":\"a\",\"1\":1,\"2\":\"a\"}", e.Execute("testFunc.bind('anything')('a', 1, 'a');").GetCompletionValue().AsString());
|
|
Assert.Equal("a, 1, a, {\"0\":\"a\",\"1\":1,\"2\":\"a\"}", e.Execute("testFunc.bind('anything')('a', 1, 'a');").GetCompletionValue().AsString());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ [Fact]
|
|
|
|
+ public void ProxyCanBeRevokedWithoutContext()
|
|
|
|
+ {
|
|
|
|
+ new Engine()
|
|
|
|
+ .Execute(@"
|
|
|
|
+ var revocable = Proxy.revocable({}, {});
|
|
|
|
+ var revoke = revocable.revoke;
|
|
|
|
+ revoke.call(null);
|
|
|
|
+ ");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ [Fact]
|
|
|
|
+ public void ArrowFunctionShouldBeExtensible()
|
|
|
|
+ {
|
|
|
|
+ new Engine()
|
|
|
|
+ .SetValue("assert", new Action<bool>(Assert.True))
|
|
|
|
+ .Execute(@"
|
|
|
|
+ var a = () => null
|
|
|
|
+ Object.defineProperty(a, 'hello', { enumerable: true, get: () => 'world' })
|
|
|
|
+ assert(a.hello === 'world')
|
|
|
|
+
|
|
|
|
+ a.foo = 'bar';
|
|
|
|
+ assert(a.foo === 'bar');
|
|
|
|
+ ");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|