@@ -30936,7 +30936,7 @@ function lower$1(func, env, bindings = null, capturedRefs = new Map()) {
3093630936 });
3093730937}
3093830938function lowerStatement(builder, stmtPath, label = null) {
30939- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29;
30939+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33 ;
3094030940 const stmtNode = stmtPath.node;
3094130941 switch (stmtNode.type) {
3094230942 case 'ThrowStatement': {
@@ -31823,12 +31823,40 @@ function lowerStatement(builder, stmtPath, label = null) {
3182331823 }, continuationBlock);
3182431824 return;
3182531825 }
31826+ case 'WithStatement': {
31827+ builder.errors.push({
31828+ reason: `JavaScript 'with' syntax is not supported`,
31829+ description: `'with' syntax is considered deprecated and removed from JavaScript standards, consider alternatives`,
31830+ severity: ErrorSeverity.InvalidJS,
31831+ loc: (_28 = stmtPath.node.loc) !== null && _28 !== void 0 ? _28 : null,
31832+ suggestions: null,
31833+ });
31834+ lowerValueToTemporary(builder, {
31835+ kind: 'UnsupportedNode',
31836+ loc: (_29 = stmtPath.node.loc) !== null && _29 !== void 0 ? _29 : GeneratedSource,
31837+ node: stmtPath.node,
31838+ });
31839+ return;
31840+ }
31841+ case 'ClassDeclaration': {
31842+ builder.errors.push({
31843+ reason: `Support nested class declarations`,
31844+ severity: ErrorSeverity.Todo,
31845+ loc: (_30 = stmtPath.node.loc) !== null && _30 !== void 0 ? _30 : null,
31846+ suggestions: null,
31847+ });
31848+ lowerValueToTemporary(builder, {
31849+ kind: 'UnsupportedNode',
31850+ loc: (_31 = stmtPath.node.loc) !== null && _31 !== void 0 ? _31 : GeneratedSource,
31851+ node: stmtPath.node,
31852+ });
31853+ return;
31854+ }
3182631855 case 'TypeAlias':
3182731856 case 'TSInterfaceDeclaration':
3182831857 case 'TSTypeAliasDeclaration': {
3182931858 return;
3183031859 }
31831- case 'ClassDeclaration':
3183231860 case 'DeclareClass':
3183331861 case 'DeclareExportAllDeclaration':
3183431862 case 'DeclareExportDeclaration':
@@ -31851,17 +31879,16 @@ function lowerStatement(builder, stmtPath, label = null) {
3185131879 case 'TSExportAssignment':
3185231880 case 'TSImportEqualsDeclaration':
3185331881 case 'TSModuleDeclaration':
31854- case 'TSNamespaceExportDeclaration':
31855- case 'WithStatement': {
31882+ case 'TSNamespaceExportDeclaration': {
3185631883 builder.errors.push({
3185731884 reason: `(BuildHIR::lowerStatement) Handle ${stmtPath.type} statements`,
3185831885 severity: ErrorSeverity.Todo,
31859- loc: (_28 = stmtPath.node.loc) !== null && _28 !== void 0 ? _28 : null,
31886+ loc: (_32 = stmtPath.node.loc) !== null && _32 !== void 0 ? _32 : null,
3186031887 suggestions: null,
3186131888 });
3186231889 lowerValueToTemporary(builder, {
3186331890 kind: 'UnsupportedNode',
31864- loc: (_29 = stmtPath.node.loc) !== null && _29 !== void 0 ? _29 : GeneratedSource,
31891+ loc: (_33 = stmtPath.node.loc) !== null && _33 !== void 0 ? _33 : GeneratedSource,
3186531892 node: stmtPath.node,
3186631893 });
3186731894 return;
@@ -33634,7 +33661,7 @@ function lowerValueToTemporary(builder, value) {
3363433661 return place;
3363533662}
3363633663function lowerIdentifier(builder, exprPath) {
33637- var _a;
33664+ var _a, _b ;
3363833665 const exprNode = exprPath.node;
3363933666 const exprLoc = (_a = exprNode.loc) !== null && _a !== void 0 ? _a : GeneratedSource;
3364033667 const binding = builder.resolveIdentifier(exprPath);
@@ -33650,6 +33677,15 @@ function lowerIdentifier(builder, exprPath) {
3365033677 return place;
3365133678 }
3365233679 default: {
33680+ if (binding.kind === 'Global' && binding.name === 'eval') {
33681+ builder.errors.push({
33682+ reason: `The 'eval' function is not supported`,
33683+ description: 'Eval is an anti-pattern in JavaScript, and the code executed cannot be evaluated by React Compiler',
33684+ severity: ErrorSeverity.InvalidJS,
33685+ loc: (_b = exprPath.node.loc) !== null && _b !== void 0 ? _b : null,
33686+ suggestions: null,
33687+ });
33688+ }
3365333689 return lowerValueToTemporary(builder, {
3365433690 kind: 'LoadGlobal',
3365533691 binding,
0 commit comments