-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code refactoring for container package #14989
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -668,8 +668,8 @@ Registry.prototype = { | |
|
||
let localKnown = dictionary(null); | ||
let registeredNames = Object.keys(this.registrations); | ||
for (let index = 0; index < registeredNames.length; index++) { | ||
let fullName = registeredNames[index]; | ||
for (let i = 0; i < registeredNames.length; i++) { | ||
let fullName = registeredNames[i]; | ||
let itemType = fullName.split(':')[0]; | ||
|
||
if (itemType === type) { | ||
|
@@ -732,31 +732,31 @@ Registry.prototype = { | |
getInjections(fullName) { | ||
let injections = this._injections[fullName] || []; | ||
if (this.fallback) { | ||
injections = injections.concat(this.fallback.getInjections(fullName)); | ||
injections.push(...this.fallback.getInjections(fullName)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so you are modifying There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope you are not polluting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. before/after is not same here, so each time you call |
||
} | ||
return injections; | ||
}, | ||
|
||
getTypeInjections(type) { | ||
let injections = this._typeInjections[type] || []; | ||
if (this.fallback) { | ||
injections = injections.concat(this.fallback.getTypeInjections(type)); | ||
injections.push(...this.fallback.getTypeInjections(type)); | ||
} | ||
return injections; | ||
}, | ||
|
||
getFactoryInjections(fullName) { | ||
let injections = this._factoryInjections[fullName] || []; | ||
if (this.fallback) { | ||
injections = injections.concat(this.fallback.getFactoryInjections(fullName)); | ||
injections.push(...this.fallback.getFactoryInjections(fullName)); | ||
} | ||
return injections; | ||
}, | ||
|
||
getFactoryTypeInjections(type) { | ||
let injections = this._factoryTypeInjections[type] || []; | ||
if (this.fallback) { | ||
injections = injections.concat(this.fallback.getFactoryTypeInjections(type)); | ||
injections.push(...this.fallback.getFactoryTypeInjections(type)); | ||
} | ||
return injections; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We typically want to avoid lines that are too long. I also feel the former is easier to read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking at this pull request. Should I replace it?