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

NPE and Incorrect docs for $httpBackend.matchLatestDefinitionEnabled #16702

Closed
@Algatron

Description

@Algatron

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions