You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the line below, the method TotalSeconds is called 4 times (to check add a console.log in the implementations): ? CreateObject("roTimeSpan").TotalSeconds().ToStr().Trim()
This is also happening for similar chained calls such as:
" 3 ".trim().toInt()
where trim() is called twice. I also found this has always behaved this way and went unnoticed since most of the chained functions had little to no side effects and only their values were used in testing. I also confirmed that this seems specific to function chaining and other cases like 1 + 2 + 3 have the appropriate number of addition operations.
Using the example above, it appears the trim() call is evaluated once in Interpreter.visitDottedGet() and evaluated in Interpreter.visitCall(). While this has some performance concerns, this can certainly introduce more problems when more functions with side effects are introduced. I'll start looking at some options. I'm guessing the Interpreter.visitCall() is the appropriate place to do this evaluation and Interpreter.visitDottedGet() needs to be updated.
The text was updated successfully, but these errors were encountered:
In the line below, the method
TotalSeconds
is called 4 times (to check add aconsole.log
in the implementations):? CreateObject("roTimeSpan").TotalSeconds().ToStr().Trim()
User @strattonbrazil also reported:
The text was updated successfully, but these errors were encountered: