@@ -210,7 +210,7 @@ export function function_declaration(id, params, body) {
210
210
/**
211
211
* @param {string } name
212
212
* @param {import('estree').Statement[] } body
213
- * @returns {import('estree').Property }
213
+ * @returns {import('estree').Property & { value: import('estree').FunctionExpression} } }
214
214
*/
215
215
export function get ( name , body ) {
216
216
return prop ( 'get' , key ( name ) , function_builder ( null , [ ] , block ( body ) ) ) ;
@@ -305,11 +305,12 @@ export function object_pattern(properties) {
305
305
}
306
306
307
307
/**
308
+ * @template {import('estree').Expression} Value
308
309
* @param {'init' | 'get' | 'set' } kind
309
310
* @param {import('estree').Expression } key
310
- * @param {import('estree').Expression } value
311
+ * @param {Value } value
311
312
* @param {boolean } computed
312
- * @returns {import('estree').Property }
313
+ * @returns {import('estree').Property & { value: Value } }
313
314
*/
314
315
export function prop ( kind , key , value , computed = false ) {
315
316
return { type : 'Property' , kind, key, value, method : false , shorthand : false , computed } ;
@@ -355,23 +356,10 @@ export function sequence(expressions) {
355
356
/**
356
357
* @param {string } name
357
358
* @param {import('estree').Statement[] } body
358
- * @param {import('estree').Expression | null } [fallback]
359
- * @returns {import('estree').Property }
359
+ * @returns {import('estree').Property & { value: import('estree').FunctionExpression} }
360
360
*/
361
- export function set ( name , body , fallback ) {
362
- return prop (
363
- 'set' ,
364
- key ( name ) ,
365
- function_builder (
366
- null ,
367
- [
368
- fallback
369
- ? { type : 'AssignmentPattern' , left : id ( '$$value' ) , right : fallback }
370
- : id ( '$$value' )
371
- ] ,
372
- block ( body )
373
- )
374
- ) ;
361
+ export function set ( name , body ) {
362
+ return prop ( 'set' , key ( name ) , function_builder ( null , [ id ( '$$value' ) ] , block ( body ) ) ) ;
375
363
}
376
364
377
365
/**
0 commit comments