From 354fa54100a574ce14835e29c6ea96b7463c469b Mon Sep 17 00:00:00 2001 From: Bert Willems Date: Wed, 22 May 2013 20:33:31 +0200 Subject: [PATCH] fix(instrumentation): fix injecting a provider with array syntax --- js/inject/debug.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/inject/debug.js b/js/inject/debug.js index 6d96197..018acae 100644 --- a/js/inject/debug.js +++ b/js/inject/debug.js @@ -629,6 +629,17 @@ var inject = function () { return tempGet.apply(this, arguments); }; }); + } else if (definition instanceof Array) { + // it is a constructoctor with array syntax + var tempConstructor = definition[definition.length - 1]; + + definition[definition.length - 1] = function () { + debug.deps.push({ + name: name, + imports: annotate(tempConstructor) + }); + return tempConstructor.apply(this, arguments); + }; } else if (definition.$get instanceof Array) { // it should have a $get var tempGet = definition.$get[definition.$get.length - 1];