|
| 1 | + |
| 2 | +## Input |
| 3 | + |
| 4 | +```javascript |
| 5 | +import {Throw} from 'shared-runtime'; |
| 6 | + |
| 7 | +/** |
| 8 | + * Note: this is disabled in the evaluator due to different devmode errors. |
| 9 | + * Found differences in evaluator results |
| 10 | + * Non-forget (expected): |
| 11 | + * (kind: ok) <invalidtag val="[object Object]"></invalidtag> |
| 12 | + * logs: ['Warning: <%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.%s','invalidTag'] |
| 13 | + * |
| 14 | + * Forget: |
| 15 | + * (kind: ok) <invalidtag val="[object Object]"></invalidtag> |
| 16 | + * logs: [ |
| 17 | + * 'Warning: <%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.%s','invalidTag', |
| 18 | + * 'Warning: The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.%s','invalidTag', |
| 19 | + * ] |
| 20 | + */ |
| 21 | +function useFoo() { |
| 22 | + const invalidTag = Throw; |
| 23 | + /** |
| 24 | + * Need to be careful to not parse `invalidTag` as a localVar (i.e. render |
| 25 | + * Throw). Note that the jsx transform turns this into a string tag: |
| 26 | + * `jsx("invalidTag"... |
| 27 | + */ |
| 28 | + return <invalidTag val={{val: 2}} />; |
| 29 | +} |
| 30 | +export const FIXTURE_ENTRYPOINT = { |
| 31 | + fn: useFoo, |
| 32 | + params: [], |
| 33 | +}; |
| 34 | + |
| 35 | +``` |
| 36 | + |
| 37 | +## Code |
| 38 | + |
| 39 | +```javascript |
| 40 | +import { c as _c } from "react/compiler-runtime"; |
| 41 | +import { Throw } from "shared-runtime"; |
| 42 | + |
| 43 | +/** |
| 44 | + * Note: this is disabled in the evaluator due to different devmode errors. |
| 45 | + * Found differences in evaluator results |
| 46 | + * Non-forget (expected): |
| 47 | + * (kind: ok) <invalidtag val="[object Object]"></invalidtag> |
| 48 | + * logs: ['Warning: <%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.%s','invalidTag'] |
| 49 | + * |
| 50 | + * Forget: |
| 51 | + * (kind: ok) <invalidtag val="[object Object]"></invalidtag> |
| 52 | + * logs: [ |
| 53 | + * 'Warning: <%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.%s','invalidTag', |
| 54 | + * 'Warning: The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.%s','invalidTag', |
| 55 | + * ] |
| 56 | + */ |
| 57 | +function useFoo() { |
| 58 | + const $ = _c(1); |
| 59 | + let t0; |
| 60 | + if ($[0] === Symbol.for("react.memo_cache_sentinel")) { |
| 61 | + t0 = <invalidTag val={{ val: 2 }} />; |
| 62 | + $[0] = t0; |
| 63 | + } else { |
| 64 | + t0 = $[0]; |
| 65 | + } |
| 66 | + return t0; |
| 67 | +} |
| 68 | + |
| 69 | +export const FIXTURE_ENTRYPOINT = { |
| 70 | + fn: useFoo, |
| 71 | + params: [], |
| 72 | +}; |
| 73 | + |
| 74 | +``` |
| 75 | + |
0 commit comments