Tried to increase ease of use of the javascript.py module while having things make sense. Code was refactored for continuity, proper operators added, more reliable actions from methods (when methods are called with different type parameters) and finally an object lookup was added to the JavaScript object.
Still on the table is whether object methods should work inplace or return new objects. I can see pros and cons either way.
Pros for in place:
Once an object/function/code is added to a JavaScript object, we can retrieve it with the object lookup and modify it knowing that the original JavaScript object will reflect the changes
Allows easy user modification of core javascript
Cons:
Not pythonic!
Allows easy user modification of core javascript (user could easily and unintentionally ruin the javascript!)
Adds many caveats to using javascript.py
Also, up for review is my choice for object operations (mainly how I implemented addition)... does anyone have ideas regarding other operators or more elegant ways of doing this?
Tried to increase ease of use of the javascript.py module while having things make sense. Code was refactored for continuity, proper operators added, more reliable actions from methods (when methods are called with different type parameters) and finally an object lookup was added to the JavaScript object.
Still on the table is whether object methods should work inplace or return new objects. I can see pros and cons either way.
Pros for in place:
Cons:
Also, up for review is my choice for object operations (mainly how I implemented addition)... does anyone have ideas regarding other operators or more elegant ways of doing this?