[bugfix] Fix constant propagation to ObjectMethods

This commit is contained in:
Mofei Zhang
2023-12-06 13:20:50 -05:00
parent d3e84d4dff
commit 995f4b0528
4 changed files with 5 additions and 3 deletions
@@ -434,6 +434,7 @@ function evaluateInstruction(
}
return placeValue;
}
case "ObjectMethod":
case "FunctionExpression": {
constantPropagationImpl(value.loweredFunc.func, constants);
return null;
@@ -33,7 +33,7 @@ function Foo() {
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
const x = {
foo() {
return identity(CONSTANT);
return identity(1);
},
};
@@ -51,4 +51,6 @@ export const FIXTURE_ENTRYPOINT = {
};
```
### Eval output
(kind: ok) 1
@@ -515,7 +515,6 @@ const skipFilter = new Set([
"bug-jsx-memberexpr-tag-in-lambda",
"bug-invalid-code-when-bailout",
"component-syntax-ref-gating.flow",
"bug-context-vars-in-object-method",
// 'react-forget-runtime' not yet supported
"flag-enable-emit-hook-guards",