@fairfox/polly 0.92.0 → 0.92.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4298,6 +4298,19 @@ class HandlerExtractor {
4298
4298
  }
4299
4299
  return handlers;
4300
4300
  }
4301
+ isInsideHandlerRegistration(node, func) {
4302
+ let current = node.getParent();
4303
+ while (current && current !== func) {
4304
+ if (Node4.isCallExpression(current)) {
4305
+ const callee = current.getExpression();
4306
+ if (Node4.isPropertyAccessExpression(callee) && (callee.getName() === "on" || callee.getName() === "addEventListener")) {
4307
+ return true;
4308
+ }
4309
+ }
4310
+ current = current.getParent();
4311
+ }
4312
+ return false;
4313
+ }
4301
4314
  findStateMutationsInFunction(func, stateVarNames) {
4302
4315
  const mutations = [];
4303
4316
  this.recordOnSurfaceSpan(func);
@@ -4307,6 +4320,8 @@ class HandlerExtractor {
4307
4320
  const operator = node.getOperatorToken().getText();
4308
4321
  if (operator !== "=")
4309
4322
  return;
4323
+ if (this.isInsideHandlerRegistration(node, func))
4324
+ return;
4310
4325
  const left = node.getLeft();
4311
4326
  if (!Node4.isPropertyAccessExpression(left))
4312
4327
  return;
@@ -7437,4 +7452,4 @@ main().catch((_error) => {
7437
7452
  process.exit(1);
7438
7453
  });
7439
7454
 
7440
- //# debugId=F0D46FA5D13A2E3264756E2164756E21
7455
+ //# debugId=3576EDEE634B2C1F64756E2164756E21