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.

Arrow functions not working in Chrome 50 with ngMock inject #14487

Closed
@mribichich

Description

@mribichich

Hi there, before the Chrome 50 update arrow functions were working for me, but suddenly karma started to failed. The message is something with the Injector.

I dont know if arrow functions were intended to work or not, but they dont work anymore.

This used to work with Chrome 49.x:

 beforeEach(inject((_$controller_) => {
        $controller = _$controller_;
    }));

I solved it using function:

 beforeEach(inject(function(_$controller_) {
        $controller = _$controller_;
    }));

Here's the error message, its very easy to reproduce:

TypeError: Cannot read property '1' of null
            at Function.annotate (/bower_components/angular/angular.js:3907:24)
            at Function.angular.injector.$$annotate (/bower_components/angular-mocks/angular-mocks.js:2583:36)
            at injectionArgs (/bower_components/angular/angular.js:4626:36)
            at Object.invoke (/bower_components/angular/angular.js:4657:18)
            at Object.workFn (/bower_components/angular-mocks/angular-mocks.js:2810:20)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions