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

Commit bb73070

Browse files
committedApr 28, 2016
fix($injector): add workaround for fat-arrow stringification in Chrome v50/51
Closes #14487 Closes #14495
1 parent 8965d57 commit bb73070

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

Diff for: ‎src/auto/injector.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
7171
var $injectorMinErr = minErr('$injector');
7272

7373
function extractArgs(fn) {
74-
var fnText = Function.prototype.toString.call(fn).replace(STRIP_COMMENTS, ''),
74+
// Support: Chrome 50-51 only
75+
// Creating a new string by adding `' '` at the end, to hack around some bug in Chrome v50/51
76+
// (See https://github.com/angular/angular.js/issues/14487.)
77+
// TODO (gkalpak): Remove workaround when Chrome v52 is released
78+
var fnText = Function.prototype.toString.call(fn).replace(STRIP_COMMENTS, '') + ' ',
7579
args = fnText.match(ARROW_ARG) || fnText.match(FN_ARGS);
7680
return args;
7781
}

0 commit comments

Comments
 (0)
This repository has been archived.