chore: fix types of binding.blocker (#17177)

pull/17178/head
Rich Harris 2 days ago committed by GitHub
parent b94289d23b
commit fe50e58f34
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1184,7 +1184,15 @@ function calculate_blockers(instance, scopes, analysis) {
trace_references(body, reads_writes, reads_writes);
const max = [...reads_writes].reduce((max, binding) => {
return binding.blocker ? Math.max(binding.blocker.property.value, max) : max;
if (binding.blocker) {
let property = /** @type {ESTree.SimpleLiteral & { value: number }} */ (
binding.blocker.property
);
return Math.max(property.value, max);
}
return max;
}, -1);
if (max === -1) continue;

@ -141,7 +141,7 @@ export class Binding {
* otherwise the initial value will not have been assigned.
* It is a member expression of the form `$$blockers[n]`.
* TODO the blocker is set during transform which feels a bit grubby
* @type {MemberExpression & { object: Identifier, property: SimpleLiteral & { value: number } } | null}
* @type {MemberExpression | null}
*/
blocker = null;

Loading…
Cancel
Save