Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,12 @@ export function processInstanceScriptContent(
// handle $store++, $store--, ++$store, --$store
if (
(ts.isPrefixUnaryExpression(parent) || ts.isPostfixUnaryExpression(parent)) &&
parent.operator !==
ts.SyntaxKind.ExclamationToken /* `!$store` does not need processing */
![
ts.SyntaxKind.ExclamationToken, // !$store
ts.SyntaxKind.PlusToken, // +$store
ts.SyntaxKind.MinusToken, // -$store
ts.SyntaxKind.TildeToken // ~$store
].includes(parent.operator) /* `!$store` etc does not need processing */
) {
let simpleOperator: string;
if (parent.operator === ts.SyntaxKind.PlusPlusToken) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ function render() {

const count = writable(0)/*Ωignore_startΩ*/;let $count = __sveltets_1_store_get(count);/*Ωignore_endΩ*/;
const handler1 = () => !(__sveltets_1_store_get(count), $count)
const handler2 = () => +(__sveltets_1_store_get(count), $count)
const handler3 = () => -(__sveltets_1_store_get(count), $count)
const handler4 = () => ~(__sveltets_1_store_get(count), $count)
;
() => (<>

<button onclick={() => !(__sveltets_1_store_get(count), $count)}>add</button></>);
<button onclick={() => !(__sveltets_1_store_get(count), $count)}>add</button>
<button onclick={() => +(__sveltets_1_store_get(count), $count)}>add</button>
<button onclick={() => -(__sveltets_1_store_get(count), $count)}>add</button>
<button onclick={() => ~(__sveltets_1_store_get(count), $count)}>add</button></>);
return { props: {}, slots: {}, getters: {}, events: {} }}

export default class Input__SvelteComponent_ extends __sveltets_1_createSvelte2TsxComponent(__sveltets_1_partial(__sveltets_1_with_any_event(render()))) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script>
import { writable } from 'svelte/store';
const count = writable(0);
const handler1 = () => !$count
const handler2 = () => +$count
const handler3 = () => -$count
const handler4 = () => ~$count
</script>

<button on:click={() => !$count}>add</button>
<button on:click={() => +$count}>add</button>
<button on:click={() => -$count}>add</button>
<button on:click={() => ~$count}>add</button>