This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 99811

Summary: if functions are declared in different way are not in cc
Product: javascript Reporter: Lukasz Grela <lgrela>
Component: EditorAssignee: Daniel Prusa <dprusa>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Lukasz Grela 2007-04-03 14:09:54 UTC
after declaring function using one of depicted  below approach, the function is
not available in cc.

add = new Function("a", "b", "return a+b;");

add = function(a, b) {
  return a+b;
}
Comment 1 Daniel Prusa 2007-04-10 12:58:21 UTC
We cannot support dynamicaly created methods in cc since it is not posible to
determine in which scope such a method is visible. We know scope of variable
'add' and thus it can be offered by cc as a varible, but it is not possible to
track values assigned into it.

The only use case that should be fixed is declaration of object's function like:

Number.add = new Function("a", "b", "return a+b;")
Comment 2 Jan Jancura 2007-05-23 14:32:17 UTC
>feature
Comment 3 Petr Pisl 2012-08-29 12:48:02 UTC
In the js editor in NB 7.3, the cc offers both cases. Only at the first case, it offers add as variable, not a function.