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

Summary: Function with reserved name marked as error inside ng directive
Product: web Reporter: Vladimir Riha <vriha>
Component: AngularJSAssignee: Petr Pisl <ppisl>
Status: NEW ---    
Severity: normal CC: ppisl
Priority: P4    
Version: 7.4   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

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.