diff options
| author | Igor Minar | 2012-03-28 17:20:12 -0700 |
|---|---|---|
| committer | Igor Minar | 2012-03-29 11:21:04 -0700 |
| commit | 2cb907a8366e3273890f5ef6174b2e3970cd1720 (patch) | |
| tree | 3ddb2b21cdec49752e3157ec9e60e1323f07a250 /test | |
| parent | 2f2fd465a40f675c969effd2324611533929fb73 (diff) | |
| download | angular.js-2cb907a8366e3273890f5ef6174b2e3970cd1720.tar.bz2 | |
fix($injector): properly infer dependencies from fn with no args
Previously if there was a white-space in fn: fn( ) {} we failed to infer no args.
This was originally reported by recht, but I decided to use a different fix.
Closes #829
Diffstat (limited to 'test')
| -rw-r--r-- | test/auto/injectorSpec.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/auto/injectorSpec.js b/test/auto/injectorSpec.js index 16cf1524..83bd3d1f 100644 --- a/test/auto/injectorSpec.js +++ b/test/auto/injectorSpec.js @@ -160,6 +160,13 @@ describe('injector', function() { }); + it('should handle no arg functions with spaces in the arguments list', function() { + function fn( ) {} + expect(inferInjectionArgs(fn)).toEqual([]); + expect(fn.$inject).toEqual([]); + }); + + it('should handle args with both $ and _', function() { function $f_n0($a_) {} expect(inferInjectionArgs($f_n0)).toEqual(['$a_']); |
