diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver-and-mutate.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver-and-mutate.expect.md index c405f36edb..73d7cdd078 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver-and-mutate.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver-and-mutate.expect.md @@ -2,10 +2,12 @@ ## Input ```javascript +import { makeObject_Primitives, mutate } from "shared-runtime"; + function Component() { // a's mutable range should be the same as x's mutable range, // since a is captured into x (which gets mutated later) - let a = someObj(); + let a = makeObject_Primitives(); let x = []; x.push(a); @@ -14,18 +16,26 @@ function Component() { return [x, a]; } +export const FIXTURE_ENTRYPOINT = { + fn: Component, + params: [], + isComponent: false, +}; + ``` ## Code ```javascript import { unstable_useMemoCache as useMemoCache } from "react"; +import { makeObject_Primitives, mutate } from "shared-runtime"; + function Component() { const $ = useMemoCache(3); let x; let a; if ($[0] === Symbol.for("react.memo_cache_sentinel")) { - a = someObj(); + a = makeObject_Primitives(); x = []; x.push(a); @@ -47,5 +57,11 @@ function Component() { return t0; } +export const FIXTURE_ENTRYPOINT = { + fn: Component, + params: [], + isComponent: false, +}; + ``` \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver-and-mutate.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver-and-mutate.js index 13470813eb..b9c7b9e0d0 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver-and-mutate.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/alias-capture-in-method-receiver-and-mutate.js @@ -1,7 +1,9 @@ +import { makeObject_Primitives, mutate } from "shared-runtime"; + function Component() { // a's mutable range should be the same as x's mutable range, // since a is captured into x (which gets mutated later) - let a = someObj(); + let a = makeObject_Primitives(); let x = []; x.push(a); @@ -9,3 +11,9 @@ function Component() { mutate(x); return [x, a]; } + +export const FIXTURE_ENTRYPOINT = { + fn: Component, + params: [], + isComponent: false, +}; diff --git a/compiler/packages/sprout/src/SproutTodoFilter.ts b/compiler/packages/sprout/src/SproutTodoFilter.ts index c9aee8d29a..936085bd22 100644 --- a/compiler/packages/sprout/src/SproutTodoFilter.ts +++ b/compiler/packages/sprout/src/SproutTodoFilter.ts @@ -181,7 +181,6 @@ const skipFilter = new Set([ * Category C: * Tests with at 0 params and at least one ref to external values */ - "alias-capture-in-method-receiver-and-mutate", "alias-capture-in-method-receiver", "alias-nested-member-path-mutate", "chained-assignment-context-variable",