-
-
Notifications
You must be signed in to change notification settings - Fork 379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support of accessing index of dynamic object #142
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much!
Just added some minor comments.
@@ -105,6 +106,15 @@ public void Case_Insensitive_Dynamic_Members() | |||
Assert.Throws<RuntimeBinderException>(() => interpreter.Eval("dyn.BAR", new Parameter("dyn", dyn))); | |||
} | |||
|
|||
[Test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some minor code alignment problems here and in other files? Probably due to tab/space mismatch ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i will format codes again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix 5e133f3
var interpreter = new Interpreter().SetVariable("dyn", (object)dyn); | ||
Assert.AreEqual(dyn.Sub[0], interpreter.Eval("dyn.Sub[0]")); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it makes sense to try some invalid cases?
Here some suggestions that I would expect should generate a parse exception:
- try to use index for a property that is not an array
- try to use as an index an invalid type (like passing a string?)
- try to pass some invalid syntax like
dyn.Sub[0
,dyn.Sub 0]
ordyn.Sub[[0]]
- try to get an out of bound element (this just to check that exception are handled correctly ... )
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add more cases like what you said. Thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix cfe6d99
It would be very nice that you could also add a note in the README regarding this new dynamic feature (currently there isn't a specific section for dynamic, it is only mentioned in |
I would add some notes to |
Done! Thanks! |
Thank you! Merged! |
Release v2.5.0 with these changes. |
Fixes #127, #92
Thanks !