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 - if functions are declared in different way are not in cc
Summary: if functions are declared in different way are not in cc
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Daniel Prusa
Depends on:
Reported: 2007-04-03 14:09 UTC by Lukasz Grela
Modified: 2012-08-29 12:48 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
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
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.