Преглед изворни кода

fix(inject): change warn message when trying to mutate an injected value (#5243)

Raymond Rutjes пре 9 година
родитељ
комит
23a058ed13
2 измењених фајлова са 4 додато и 4 уклоњено
  1. 2 2
      src/core/instance/inject.js
  2. 2 2
      test/unit/features/options/inject.spec.js

+ 2 - 2
src/core/instance/inject.js

@@ -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
               )
             })

+ 2 - 2
test/unit/features/options/inject.spec.js

@@ -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()
   })
 })