Making ClrFunctionInstance extensible
@@ -1495,5 +1495,18 @@ namespace Jint.Tests.Runtime
assert(target[key] == 3);
");
}
+
+ [Fact]
+ public void ObjectShouldBeExtensible()
+ {
+ RunTest(@"
+ try {
+ Object.defineProperty(Object.defineProperty, 'foo', { value: 1 });
+ }
+ catch(e) {
+ assert(false);
+ ");
@@ -17,6 +17,7 @@ namespace Jint.Runtime.Interop
_func = func;
Prototype = engine.Function.PrototypeObject;
FastAddProperty("length", length, false, false, false);
+ Extensible = true;
public ClrFunctionInstance(Engine engine, Func<JsValue, JsValue[], JsValue> func)