Skip to content

Commit 574162e

Browse files
committed
normalizeInect should return for non-array
1 parent bfda503 commit 574162e

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/core/util/options.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -253,21 +253,17 @@ function normalizeProps (options: Object) {
253253
*/
254254
function normalizeInject (options: Object) {
255255
const inject = options.inject
256-
if (!inject) return
257-
let res = {}
258-
let i, val
259-
if (Array.isArray(inject)) {
260-
i = inject.length
261-
while (i--) {
262-
val = inject[i]
263-
if (typeof val === 'string') {
264-
res[val] = val
265-
} else if (process.env.NODE_ENV !== 'production') {
266-
warn('inject must be strings when using array syntax.')
267-
}
256+
if (!Array.isArray(inject)) return
257+
const res = {}
258+
let i = inject.length
259+
let val
260+
while (i--) {
261+
val = inject[i]
262+
if (typeof val === 'string') {
263+
res[val] = val
264+
} else if (process.env.NODE_ENV !== 'production') {
265+
warn('inject must be strings when using array syntax.')
268266
}
269-
} else if (isPlainObject(inject)) {
270-
res = options.inject
271267
}
272268
options.inject = res
273269
}

0 commit comments

Comments
 (0)