]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
wip: warning
authorEvan You <yyx990803@gmail.com>
Wed, 3 Oct 2018 17:03:20 +0000 (13:03 -0400)
committerEvan You <yyx990803@gmail.com>
Wed, 3 Oct 2018 17:03:20 +0000 (13:03 -0400)
packages/core/src/warning.ts [new file with mode: 0644]

diff --git a/packages/core/src/warning.ts b/packages/core/src/warning.ts
new file mode 100644 (file)
index 0000000..80f9ad3
--- /dev/null
@@ -0,0 +1,20 @@
+import { MountedComponent, ComponentType } from './component'
+
+let currentComponent: MountedComponent | null = null
+let currentComponentDefinition: ComponentType | null = null
+
+export function setCurrentComponent(c: MountedComponent) {
+  currentComponent = c
+}
+
+export function unsetCurrentComponent() {
+  currentComponent = null
+}
+
+export function setCurrentComponentDefinition(d: ComponentType) {
+  currentComponentDefinition = d
+}
+
+export function unsetCurrentComponentDefinition() {
+  currentComponentDefinition = null
+}