Skip to content

Commit

Permalink
fix(inject): change warn message when trying to mutate an injected va…
Browse files Browse the repository at this point in the history
…lue (#5243)
  • Loading branch information
rayrutjes authored and znck committed Mar 21, 2017
1 parent 7dea9f1 commit 23a058e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/instance/inject.js
Expand Up @@ -34,9 +34,9 @@ export function initInjections (vm: Component) {
if (process.env.NODE_ENV !== 'production') {
defineReactive(vm, key, source._provided[provideKey], () => {
warn(
`Avoid mutating a injections directly since the value will be ` +
`Avoid mutating an injected value directly since the changes will be ` +
`overwritten whenever the provided component re-renders. ` +
`injections being mutated: "${key}"`,
`injection being mutated: "${key}"`,
vm
)
})
Expand Down
4 changes: 2 additions & 2 deletions test/unit/features/options/inject.spec.js
Expand Up @@ -213,8 +213,8 @@ describe('Options provide/inject', () => {
expect(child.foo).toBe(1)
child.foo = 2
expect(
`Avoid mutating a injections directly since the value will be ` +
`Avoid mutating an injected value directly since the changes will be ` +
`overwritten whenever the provided component re-renders. ` +
`injections being mutated: "${key}"`).toHaveBeenWarned()
`injection being mutated: "${key}"`).toHaveBeenWarned()
})
})

0 comments on commit 23a058e

Please sign in to comment.