|
@@ -304,4 +304,16 @@ return get + '' === ""length,0,1,2,3"";";
|
|
|
var engine = new Engine();
|
|
|
Assert.True(engine.Evaluate(Script).AsBoolean());
|
|
|
}
|
|
|
+
|
|
|
+ [Fact]
|
|
|
+ public void ShouldBeAbleToInitFromArray()
|
|
|
+ {
|
|
|
+ var engine = new Engine();
|
|
|
+ var propertyDescriptors = new JsArray(engine, new JsValue[] { 1 }).GetOwnProperties().ToArray();
|
|
|
+ Assert.Equal(2, propertyDescriptors.Length);
|
|
|
+ Assert.Equal("0", propertyDescriptors[0].Key);
|
|
|
+ Assert.Equal(1, propertyDescriptors[0].Value.Value);
|
|
|
+ Assert.Equal("length", propertyDescriptors[1].Key);
|
|
|
+ Assert.Equal(1, propertyDescriptors[1].Value.Value);
|
|
|
+ }
|
|
|
}
|