From ccc61a71d86dacfb1710787c460e4cc4c66731c9 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Fri, 27 Nov 2020 21:06:36 +0800 Subject: [PATCH] add missing export for hasContext (#5727) --- CHANGELOG.md | 4 ++++ src/runtime/index.ts | 1 + test/runtime/samples/context-api-c/Leaf.svelte | 7 +++++++ test/runtime/samples/context-api-c/Nested.svelte | 11 +++++++++++ test/runtime/samples/context-api-c/_config.js | 6 ++++++ test/runtime/samples/context-api-c/main.svelte | 12 ++++++++++++ 6 files changed, 41 insertions(+) create mode 100644 test/runtime/samples/context-api-c/Leaf.svelte create mode 100644 test/runtime/samples/context-api-c/Nested.svelte create mode 100644 test/runtime/samples/context-api-c/_config.js create mode 100644 test/runtime/samples/context-api-c/main.svelte diff --git a/CHANGELOG.md b/CHANGELOG.md index 8decb47ccd66..0a4b7ae56f21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Svelte changelog +## Unreleased + +* Actually export `hasContext` ([#5726](https://github.com/sveltejs/svelte/issues/5726)) + ## 3.30.0 * Add a typed `SvelteComponent` interface ([#5431](https://github.com/sveltejs/svelte/pull/5431)) diff --git a/src/runtime/index.ts b/src/runtime/index.ts index e6c0c916f23e..f1154b092f69 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -7,6 +7,7 @@ export { afterUpdate, setContext, getContext, + hasContext, tick, createEventDispatcher, SvelteComponentDev as SvelteComponent diff --git a/test/runtime/samples/context-api-c/Leaf.svelte b/test/runtime/samples/context-api-c/Leaf.svelte new file mode 100644 index 000000000000..ae61ba063c41 --- /dev/null +++ b/test/runtime/samples/context-api-c/Leaf.svelte @@ -0,0 +1,7 @@ + + +
{has}
\ No newline at end of file diff --git a/test/runtime/samples/context-api-c/Nested.svelte b/test/runtime/samples/context-api-c/Nested.svelte new file mode 100644 index 000000000000..775d55d8f125 --- /dev/null +++ b/test/runtime/samples/context-api-c/Nested.svelte @@ -0,0 +1,11 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/context-api-c/_config.js b/test/runtime/samples/context-api-c/_config.js new file mode 100644 index 000000000000..0041359a7f53 --- /dev/null +++ b/test/runtime/samples/context-api-c/_config.js @@ -0,0 +1,6 @@ +export default { + html: ` +
true
+
false
+ ` +}; diff --git a/test/runtime/samples/context-api-c/main.svelte b/test/runtime/samples/context-api-c/main.svelte new file mode 100644 index 000000000000..03ff1ae6eb44 --- /dev/null +++ b/test/runtime/samples/context-api-c/main.svelte @@ -0,0 +1,12 @@ + + + + + + + + +