angular-hint icon indicating copy to clipboard operation
angular-hint copied to clipboard

getFunctionNames / str is undefined

Open laurelnaiad opened this issue 9 years ago • 3 comments

["getFunctionNames@chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:2042:20", "ngEventHandler@chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1949:36", "invokeLinkFn@http://localhost:3000/deps/angular/angular.js:8125:9", "nodeLinkFn@http://localhost:3000/deps/angular/angular.js:7637:11", "compositeLinkFn@http://localhost:3000/deps/angular/angular.js:6993:13", "nodeLinkFn@http://localhost:3000/deps/angular/angular.js:7632:24", "compositeLinkFn@http://localhost:3000/deps/angular/angular.js:6993:13", "publicLinkFn@http://localhost:3000/deps/angular/angular.js:6872:30", "$get.boundTranscludeFn@http://localhost:3000/deps/angular/angular.js:7011:16", "controllersBoundTransclude@http://localhost:3000/deps/angular/angular.js:7664:18"]
angular.js:11383 TypeError: Cannot read property 'replace' of undefined
    at getFunctionNames (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:2042:20)
    at ngEventHandler (chrome-extension://ighdmehidhipcmcojjgiloacoafjmpfk/dist/hint.js:1949:36)
    at invokeLinkFn (http://localhost:3000/deps/angular/angular.js:8125:9)
    at nodeLinkFn (http://localhost:3000/deps/angular/angular.js:7637:11)
    at compositeLinkFn (http://localhost:3000/deps/angular/angular.js:6993:13)
    at nodeLinkFn (http://localhost:3000/deps/angular/angular.js:7632:24)
    at compositeLinkFn (http://localhost:3000/deps/angular/angular.js:6993:13)
    at publicLinkFn (http://localhost:3000/deps/angular/angular.js:6872:30)
    at $get.boundTranscludeFn (http://localhost:3000/deps/angular/angular.js:7011:16)
    at controllersBoundTransclude (http://localhost:3000/deps/angular/angular.js:7664:18) <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{'btn-info': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1">

This popped up repeatedly through batarang. Something tells me it's related to funny business in angular-bootstrap, which is semi-notorious for having transclusion issues.

laurelnaiad avatar Dec 10 '14 04:12 laurelnaiad

That's because the getFunctionNames is called on attributes that don't have a value; i.e. ng-cloak

A check for undefined value is needed before calling that method;

pavlospolianidis avatar Dec 10 '14 15:12 pavlospolianidis

It's not only undefined that caudes problems, but any non- string value actually. There is a PR solving this and mentioning a few possible causes: #175

gkalpak avatar Dec 10 '14 16:12 gkalpak

+1

DmitryEfimenko avatar Dec 10 '14 18:12 DmitryEfimenko