From 72c163e8d3eb5a21f05c0dbb1a2e85015bd740fa Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sat, 29 Feb 2020 12:14:01 -0500 Subject: [PATCH] update tests --- test/js/samples/debug-hoisted/expected.js | 6 ++++++ test/js/samples/loop-protect/expected.js | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/test/js/samples/debug-hoisted/expected.js b/test/js/samples/debug-hoisted/expected.js index c77168ef4f..190ff12c50 100644 --- a/test/js/samples/debug-hoisted/expected.js +++ b/test/js/samples/debug-hoisted/expected.js @@ -50,6 +50,12 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let obj = { x: 5 }; let kobzol = 5; + const writable_props = []; + + Object.keys($$props).forEach(key => { + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(` was created with unknown prop '${key}'`); + }); + $$self.$capture_state = () => ({ obj, kobzol }); $$self.$inject_state = $$props => { diff --git a/test/js/samples/loop-protect/expected.js b/test/js/samples/loop-protect/expected.js index 127addf1d1..25cd2d9c7b 100644 --- a/test/js/samples/loop-protect/expected.js +++ b/test/js/samples/loop-protect/expected.js @@ -6,6 +6,7 @@ import { detach_dev, dispatch_dev, element, + globals, init, insert_dev, loop_guard, @@ -13,6 +14,7 @@ import { safe_not_equal } from "svelte/internal"; +const { console: console_1 } = globals; const file = undefined; function create_fragment(ctx) { @@ -102,6 +104,12 @@ function instance($$self, $$props, $$invalidate) { } while (true); } + const writable_props = []; + + Object.keys($$props).forEach(key => { + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console_1.warn(` was created with unknown prop '${key}'`); + }); + function div_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { $$invalidate(0, node = $$value);