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

fix(injector): make sure we call Function.prototype.toString not an override #14361

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(injector): make sure annotate can handle functions with overridd…
…en toString
  • Loading branch information
a510 committed Apr 6, 2016
commit c00cc16544f462d94c623ddfd8f652c81bdd7e9e
8 changes: 7 additions & 1 deletion test/auto/injectorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,13 @@ describe('injector', function() {
expect(annotate($f_n0)).toEqual(['$a_']);
expect($f_n0.$inject).toEqual(['$a_']);
});


it('should handle functions with overridden toString', function() {
function fn(a) {}
fn.toString = function () { return 'fn'; };
expect(annotate(fn)).toEqual(['a']);
expect(fn.$inject).toEqual(['a']);
});

it('should throw on non function arg', function() {
expect(function() {
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy