[ 
https://issues.apache.org/jira/browse/AMBARI-2386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13683557#comment-13683557
 ] 

Jaimin D Jetly commented on AMBARI-2386:
----------------------------------------

{color:blue} 1. It's not necessary to rename "hosts" to "controller.hosts", is 
it? Was that done for a specific purpose?{color}
tasks is the computed property that triggers on changing hosts value and also 
internally references to hosts. While debugging I came across line-539 of 
host_progress_popup.js that explicitly sets hosts and tasks to null after 
making them invisible (not sure if this is needed).
But we were taking measures to avoid null references inside tasks property and 
So we can do with hosts.

{color:blue}2.Instead of doing someProperty and then findProperty, it would be 
more efficient to do findProperty once, set it to a variable, and then check to 
see if the object is valid (someProperty does a scan on the array, and 
findProperty does another scan).{color}
Agreed. 

I will upload another patch with suggested changes. 

   
                
> Javascript error encountered occasionally on initializing Host progress popup.
> ------------------------------------------------------------------------------
>
>                 Key: AMBARI-2386
>                 URL: https://issues.apache.org/jira/browse/AMBARI-2386
>             Project: Ambari
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 1.2.5
>            Reporter: Jaimin D Jetly
>            Assignee: Jaimin D Jetly
>             Fix For: 1.2.5
>
>         Attachments: AMBARI-2386.patch
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to