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

Commit 813117d

Browse files
mgolpetebacondarwin
authored andcommitted
refactor($injector): remove the Chrome stringification hack
The Chrome stringification hack added in afcedff is no longer needed. I verified that both of the commented out tests pass on Chrome 56.
1 parent dc8762e commit 813117d

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

src/auto/injector.js

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

7373
function stringifyFn(fn) {
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-
return Function.prototype.toString.call(fn) + ' ';
74+
return Function.prototype.toString.call(fn);
7975
}
8076

8177
function extractArgs(fn) {

test/auto/injectorSpec.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,6 @@ describe('injector', function() {
284284
// eslint-disable-next-line no-eval
285285
expect(annotate(eval('a => b => b'))).toEqual(['a']);
286286
});
287-
288-
// Support: Chrome 50-51 only
289-
// TODO (gkalpak): Remove when Chrome v52 is released.
290-
// it('should be able to inject fat-arrow function', function() {
291-
// inject(($injector) => {
292-
// expect($injector).toBeDefined();
293-
// });
294-
// });
295287
}
296288

297289
if (support.classes) {
@@ -324,19 +316,6 @@ describe('injector', function() {
324316
expect(instance).toEqual(jasmine.any(Clazz));
325317
});
326318
}
327-
328-
// Support: Chrome 50-51 only
329-
// TODO (gkalpak): Remove when Chrome v52 is released.
330-
// it('should be able to invoke classes', function() {
331-
// class Test {
332-
// constructor($injector) {
333-
// this.$injector = $injector;
334-
// }
335-
// }
336-
// var instance = injector.invoke(Test, null, null, 'Test');
337-
338-
// expect(instance.$injector).toBe(injector);
339-
// });
340319
}
341320
});
342321

0 commit comments

Comments
 (0)