pull/15844/head
Rich Harris 3 months ago
parent a100bdc142
commit 70a01fc9b1

@ -165,6 +165,7 @@ export function client_component(analysis, options) {
state_fields: new Map(),
transform: {},
in_constructor: false,
in_derived: false,
instance_level_snippets: [],
module_level_snippets: [],
@ -703,6 +704,7 @@ export function client_module(analysis, options) {
state_fields: new Map(),
transform: {},
in_constructor: false,
in_derived: false,
is_instance: false
};

@ -21,6 +21,11 @@ export interface ClientTransformState extends TransformState {
*/
readonly in_constructor: boolean;
/**
* True if we're directly inside a `$derived(...)` expression (but not `$derived.by(...)`)
*/
readonly in_derived: boolean;
/** `true` if we're transforming the contents of `<script>` */
readonly is_instance: boolean;

@ -8,8 +8,5 @@ export interface TransformState {
readonly scope: Scope;
readonly scopes: Map<AST.SvelteNode, Scope>;
/** True if we're directly inside a `$derived(...)` expression (but not `$derived.by(...)`) */
readonly in_derived: boolean;
readonly state_fields: Map<string, StateField>;
}

Loading…
Cancel
Save