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 231905 - Function with reserved name marked as error inside ng directive
Summary: Function with reserved name marked as error inside ng directive
Status: NEW
Alias: None
Product: web
Classification: Unclassified
Component: AngularJS (show other bugs)
Version: 7.4
Hardware: PC Linux
: P4 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-27 08:45 UTC by Vladimir Riha
Modified: 2015-09-09 11:39 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2013-06-27 08:45:07 UTC
To reproduce, please try:

<button class="btn" ng-click="new()">New task</button>

I don't expect to be common case, but I've found it in some sample online


Product Version: NetBeans IDE Dev (Build 201306262301)
Updates: Updates available
Java: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15
System: Linux version 3.2.0-45-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Marek Fukala 2013-06-27 15:09:41 UTC
So this is supposed to work??? 

function new() {
} 

in js editor gives me a warning so I'd assume this is illegal...
Comment 2 Vladimir Riha 2013-06-27 15:12:47 UTC
Nope, since the ng-directive is inside controller's scope, the function is declared 

$scope.new = function(){

}

I'm not saying it is a good name, but I saw e.g. mongoose (not related JS framework) uses in() and where() as function names.