Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Logic problem
Message
From
09/02/2018 03:12:09
 
General information
Forum:
HTML5
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01657073
Message ID:
01658041
Views:
45
Untested: as JS has static methods in new version, you should be able to create a existsAndIsPristine Method on form class without running into Nullpointer issues
or
(no need to test) just create a traditional function for it,

as newer JS engines are very agressive towards inlining.
If run often I'd say the danger of sometimes NOT inlining should be enough to let the source as it is.
In C it would be tailor-made for preprocessor statement, but as JS does not have one, you always run the danger of added runtime of function calls if breaking up long logical statements.

>I'm having another problem I'm trying to figure out. Here is the current code which seems to be working:
>
>
>if (this.form && !this.form.$dirty || this.parentForm && !this.parentForm.$dirty) {
>            onRouteChangeOff();
>            return;
>        }
>
>However, I'm confused in this code. The idea is to make sure that if form is defined it's in pristine state and if parentForm is defined it's also in the pristine state.
>
>Do you see how to re-state the above to convey the intent of this code more clearly?
>
>Thanks in advance.
Previous
Reply
Map
View

Click here to load this message in the networking platform