Skip to content

Commit cee8ece

Browse files
committed
Blocklist -> Allowlist
1 parent 1cde7d7 commit cee8ece

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

compiler/packages/babel-plugin-react-compiler/src/Optimization/ConstantPropagation.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,12 @@ function evaluateInstruction(
540540

541541
const expressionValue = subExprValue.value;
542542
if (
543-
(typeof expressionValue === 'object' && expressionValue !== null) ||
544-
typeof expressionValue === 'symbol' ||
545-
typeof expressionValue === 'function'
543+
typeof expressionValue !== 'number' &&
544+
typeof expressionValue !== 'string' &&
545+
typeof expressionValue !== 'boolean' &&
546+
!(typeof expressionValue === 'object' && expressionValue === null)
546547
) {
547-
// value is not supported (function, object) or invalid (symbol)
548+
// value is not supported (function, object) or invalid (symbol), or something else
548549
return null;
549550
}
550551

0 commit comments

Comments
 (0)