-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
https://svelte.dev/repl/bd49de5726ac4426a5a56da473578de8?version=3.29.0
<script>
const action = () => ({
foo: "bar",
update() {
console.log(this); // null
},
destroy() {
console.log(this); // undefined
},
});
let leet = 1337;
Promise.resolve()
.then(() => leet++)
.then(() => leet++);
</script>
{#if leet < 1339}
<div use:action={{ leet }} />
{/if}
Changes needed:
- action_action.update.call(null, { leet: /*leet*/ ctx[0] })
+ action_action.update({ leet: /*leet*/ ctx[0] })function action_destroyer(action_result) {
- return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
+ return action_result && is_function(action_result.destroy) ? action_result.destroy.bind(action_result) : noop;
}