-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into pay-1142-rbac-telemetry
- Loading branch information
Showing
12 changed files
with
62 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
diff --git a/cjs/container-instance.class.js b/cjs/container-instance.class.js | ||
index e473b1e652aa0b6e7462f7ba93fcef2812483b20..1e406113d68c401ee170c997afb53e5f71edeee2 100644 | ||
index e473b1e652aa0b6e7462f7ba93fcef2812483b20..9e57857e5584373b88a9fad3fbb37bbcc56b554a 100644 | ||
--- a/cjs/container-instance.class.js | ||
+++ b/cjs/container-instance.class.js | ||
@@ -209,6 +209,7 @@ class ContainerInstance { | ||
// this allows us to support javascript where we don't have decorators and emitted metadata about dependencies | ||
// need to be injected, and user can use provided container to get instances he needs | ||
params.push(this); | ||
+ if (process.env.NODE_ENV === 'production') Object.freeze(constructableTargetType.prototype); | ||
value = new constructableTargetType(...params); | ||
// TODO: Calling this here, leads to infinite loop, because @Inject decorator registerds a handler | ||
// TODO: which calls Container.get, which will check if the requested type has a value set and if not | ||
@@ -234,6 +235,7 @@ class ContainerInstance { | ||
@@ -234,6 +234,9 @@ class ContainerInstance { | ||
*/ | ||
initializeParams(target, paramTypes) { | ||
return paramTypes.map((paramType, index) => { | ||
+ if (paramType === undefined) throw new ReferenceError('Cannot inject an `undefined` dependency. Possibly a circular dependency detected'); | ||
+ if (paramType === undefined) { | ||
+ throw new ReferenceError(`Circular dependency: Target${target.name}. Index: ${index} `); | ||
+ } | ||
const paramHandler = container_class_1.Container.handlers.find(handler => { | ||
/** | ||
* @Inject()-ed values are stored as parameter handlers and they reference their target | ||
* @Inject()-ed values are stored as parameter handlers and they reference their target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.