@@ -137,86 +137,7 @@ export function ClassBody(node, context) {
137137 )
138138 ) ;
139139 }
140-
141- // if (definition.type === 'PropertyDefinition') {
142- // const original_name = get_name(definition.key);
143- // if (original_name === null) continue;
144-
145- // const name = definition_names[original_name];
146-
147- // const is_private = definition.key.type === 'PrivateIdentifier';
148- // const field = (is_private ? private_state : public_state).get(name);
149-
150- // if (definition.value?.type === 'CallExpression' && field !== undefined) {
151- // let value = null;
152-
153- // if (definition.value.arguments.length > 0) {
154- // const init = /** @type {Expression } **/ (
155- // context.visit(definition.value.arguments[0], child_state)
156- // );
157-
158- // value =
159- // field.kind === 'state'
160- // ? b.call(
161- // '$.state',
162- // should_proxy(init, context.state.scope) ? b.call('$.proxy', init) : init
163- // )
164- // : field.kind === 'raw_state'
165- // ? b.call('$.state', init)
166- // : field.kind === 'derived_by'
167- // ? b.call('$.derived', init)
168- // : b.call('$.derived', b.thunk(init));
169- // } else {
170- // // if no arguments, we know it's state as `$derived()` is a compile error
171- // value = b.call('$.state');
172- // }
173-
174- // if (is_private) {
175- // body.push(b.prop_def(field.id, value));
176- // } else {
177- // // #foo;
178- // const member = b.member(b.this, field.id);
179- // body.push(b.prop_def(field.id, value));
180-
181- // // get foo() { return this.#foo; }
182- // body.push(b.method('get', definition.key, [], [b.return(b.call('$.get', member))]));
183-
184- // // set foo(value) { this.#foo = value; }
185- // const val = b.id('value');
186-
187- // body.push(
188- // b.method(
189- // 'set',
190- // definition.key,
191- // [val],
192- // [b.stmt(b.call('$.set', member, val, field.kind === 'state' && b.true))]
193- // )
194- // );
195- // }
196- // continue;
197- // }
198- // }
199-
200- // body.push(/** @type {MethodDefinition } **/ (context.visit(definition, child_state)));
201140 }
202141
203142 return { ...node , body } ;
204143}
205-
206- /**
207- * @param {string } name
208- * @param {Map<string, StateField> } public_state
209- */
210- function get_deconflicted_name ( name , public_state ) {
211- name = name . replace ( regex_invalid_identifier_chars , '_' ) ;
212-
213- // the above could generate conflicts because it has to generate a valid identifier
214- // so stuff like `0` and `1` or `state%` and `state^` will result in the same string
215- // so we have to de-conflict. We can only check `public_state` because private state
216- // can't have literal keys
217- while ( name && public_state . has ( name ) ) {
218- name = '_' + name ;
219- }
220-
221- return name ;
222- }
0 commit comments