03:26
<Jack Works>
having a question about ASI
03:30
<Jack Works>

I'm working on the JSX spec, with JSXElement added to the syntax, for this code:

1
<video>2</video>/g

will it be interpreted as: NumericLiteral; JSXElement divided by g
or it will not have an ASI after 1 so it becomes

(1<video)   > 2    <     /video>/g

Some comparison and a RegExp literal?

03:34
<jmdyck>
The latter.
03:34
<Jack Works>
oh thanks
03:36
<jmdyck>
ASI only kicks in when there would otherwise be a syntax error. So since "1 < video" doesn't have a syntax error, ASI doesn't insert a semicolon after the '1'.
03:37
<Jack Works>

so

1
<video>2</video>

it should be SyntaxError: unterminated regexp literal?

03:38
<Jack Works>
oh yes, "Uncaught SyntaxError: Invalid regular expression: missing /"
03:41
<Jack Works>
🤔 tried this code on babel, ts and swc. same result Unterminated regexp literal. I think the status quo is good
19:47
<devsnek>
sort of relatedly but not really relatedly does anyone know why jsx transpilers always call a function instead of just making an object?