angular / angular-hint

run-time hinting for AngularJS applications
362 stars 45 forks source link

getFunctionNames / str is undefined #60

Open laurelnaiad opened 9 years ago

laurelnaiad commented 9 years ago
["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.

pavlospolianidis commented 9 years ago

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;

gkalpak commented 9 years ago

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

DmitryEfimenko commented 9 years ago

+1