mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[bugfix] Fix constant propagation to ObjectMethods
This commit is contained in:
@@ -434,6 +434,7 @@ function evaluateInstruction(
|
||||
}
|
||||
return placeValue;
|
||||
}
|
||||
case "ObjectMethod":
|
||||
case "FunctionExpression": {
|
||||
constantPropagationImpl(value.loweredFunc.func, constants);
|
||||
return null;
|
||||
|
||||
+4
-2
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user