]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: ensure warn is dev only
authorEvan You <yyx990803@gmail.com>
Mon, 4 May 2020 14:17:40 +0000 (10:17 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 4 May 2020 14:17:40 +0000 (10:17 -0400)
packages/runtime-core/src/apiWatch.ts

index 322e38e6cf8f814e2931b3a90d3d1ecbb3af8f87..4fcc0a850b57640b43f4afa4085f03a272a9a253 100644 (file)
@@ -187,12 +187,13 @@ function doWatch(
     }
   } else {
     getter = NOOP
-    warn(
-      `Invalid watch source: `,
-      source,
-      `A watch source can only be a getter/effect function, a ref, ` +
-        `a reactive object, or an array of these types.`
-    )
+    __DEV__ &&
+      warn(
+        `Invalid watch source: `,
+        source,
+        `A watch source can only be a getter/effect function, a ref, ` +
+          `a reactive object, or an array of these types.`
+      )
   }
 
   if (cb && deep) {