angular / angular-hint

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

Angular-hint cause failure #51

Closed nhducit closed 7 years ago

nhducit commented 9 years ago

This failure was throw when application boostrap

TypeError: undefined is not a function at new (https://localhost:8072/scripts/main.js:44:11) at invoke (https://localhost:8072/bower_components/angular/angular.js:3869:17) at Object.instantiate (https://localhost:8072/bower_components/angular/angular.js:3880:23) at $get (https://localhost:8072/bower_components/angular/angular.js:7134:28) at https://localhost:8072/bower_components/angular-hint/hint.js:138:40 at https://localhost:8072/bower_components/angular-hint/hint.js:1094:38 at https://localhost:8072/bower_components/angular/angular.js:6538:34 at forEach (https://localhost:8072/bower_components/angular/angular.js:330:20) at nodeLinkFn (https://localhost:8072/bower_components/angular/angular.js:6525:11) at compositeLinkFn (https://localhost:8072/bower_components/angular/angular.js:5986:15) angular.js:9778(anonymous function) angular.js:9778$get angular.js:7216$get.Scope.$apply angular.js:12512(anonymous function) angular.js:1382invoke angular.js:3869doBootstrap angular.js:1380angular.resumeBootstrap angular.js:1402maybeBootstrap

angular: 1.2.16

my main.js file at line 44

44 $http.get('api/about').success(function (data) { $scope.about = data; });

I found root cause:

hint.js:1072

    function patchArguments (fn) {
      return function () {
        for (var i = 0, ii = arguments.length; i < ii; i++) {
          if (typeof arguments[i] === 'function') {
            arguments[i] = disallowedContext(arguments[i]);
          }
        }
        return fn.apply(this, arguments);
      };
    }

This function will change $timeout or $http function.

btford commented 9 years ago

Please provide a reproduction via jsbin, plnkr.co or jsfiddle. This saves us a lot of time. Thanks!

Narretz commented 7 years ago

I'm going to close this issue because we have no reproduction of the issue. Feel free to reopen this issue if you can provide a reproduction (ideally a runnable demo in a Plunker or similar. You can use this Plunker Template).