@jared-wiltshire said in Not a function:
I can confirm that the .get() method was removed from the starts and runtimes wrapper for the scripting context in Mango v3.4.0, it was listed in the release notes.
Thanks, Jared. I did not see any mention of
.get() removal in the release notes, including the meta release notes. Perhaps I looked in the wrong place. Can you please provide a link to those release notes so that I can read it in context?
What does appear to work more like the previous behavior is something like this -
if (OverVLimit.past(HOUR, 1).startsAndRuntime[true].proportion > 0) return 1;
Thanks. I just tried that, and this is the result:
Script error: TypeError: Cannot get property "proportion" of null in at line number 5 in at line number 5
So it seems that in addition to finding and deleting get() from all my scripts, I need to figure out the equivalent syntax for each , and then check for null before proceeding with the intended use, then test each script. Then I have to figure out the syntax for other .get() functions, and check multiple combinations of data to make sure each new code still works. This is quite a hassle, as I have 25 .get() calls to find among 337 metadata scripts.
The removal of
.get() is clearly breaking many scripts. I'm looking forward to hearing why
.get() was removed. If it can be put back in and released in the next week or so, I may be better off waiting for the new release rather than changing, debugging, and testing all those scripts. Since the Mango Java Script online documentation still shows .get(), I have some hope that this functionality will be restored in the next release. When do you reckon the next release will be? I also have to weigh this against a version rollback.