Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

NPE and Incorrect docs for $httpBackend.matchLatestDefinitionEnabled #16702

Closed
2 tasks
Algatron opened this issue Sep 20, 2018 · 0 comments · Fixed by #16713
Closed
2 tasks

NPE and Incorrect docs for $httpBackend.matchLatestDefinitionEnabled #16702

Algatron opened this issue Sep 20, 2018 · 0 comments · Fixed by #16713

Comments

@Algatron
Copy link

Algatron commented Sep 20, 2018

I'm submitting a ...

  • [X ] bug report
  • feature request
  • other

Current behaviour:
1 - Open the browser console.
2 - Execute a test with $httpBackend.matchLatestDefinitionEnabled(true);

An error will be thrown:
Uncaught ReferenceError: isDefined is not defined
at Function.$httpBackend.matchLatestDefinitionEnabled

Expected / new behaviour:
The matchLatestDefinitionEnabled "feature" would work instead of throwing an exception

Minimal reproduction of the problem with instructions:
Simply create a test spec, inject $httpBackend, and execute:
$httpBackend.matchLatestDefinitionEnabled(true);

AngularJS version: 1.x.y
1.7.4

Browser:
Found on Chrome 68.0.3440.106

Anything else:

The problem is right here: https://github.com/angular/bower-angular-mocks/blob/master/angular-mocks.js#L1707
isDefined is on the angular namespace, not a global. The other references to isDefined from this file do the full "angular.isDefined(...)"

The documentation also is putting the wrong method name.
@name $httpBackend#matchLatestDefinition
instead of:
@name $httpBackend#matchLatestDefinitionEnabled

@gkalpak gkalpak added this to the 1.7.x milestone Sep 21, 2018
@Narretz Narretz self-assigned this Oct 1, 2018
Narretz added a commit to Narretz/angular.js that referenced this issue Oct 5, 2018
Narretz added a commit to Narretz/angular.js that referenced this issue Oct 15, 2018
Narretz added a commit that referenced this issue Oct 15, 2018
Narretz added a commit that referenced this issue Oct 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.