Possible tidy up of JavascriptEngine::RootObject::FunctionObject

javascript

#1

If I’m not mistaken both the copy constructor and clone are unused!


On a similar note, I think ExpressionTreeBuilder's constructor can take a const String& instead.


#2

clone() is an override of the DynamicObject method, so it will be used if you have a JS object containing function objects and do a clone on the root of it.

And I think ExpressionTreeBuilder deliberately uses a by-value copy of the string (which is only a ref-count anyway) to make sure that the original one which is passed in from the outside world by reference doesn’t get modified while it’s still in use. Can’t remember the exact reason, but I don’t think this is a typo.