@@ -21088,7 +21088,7 @@ class HIRBuilder {
2108821088 }
2108921089 }
2109021090 resolveBinding(node) {
21091- var _a, _b;
21091+ var _a, _b, _c ;
2109221092 if (node.name === 'fbt') {
2109321093 CompilerError.throwDiagnostic({
2109421094 severity: ErrorSeverity.Todo,
@@ -21104,6 +21104,21 @@ class HIRBuilder {
2110421104 ],
2110521105 });
2110621106 }
21107+ if (node.name === 'this') {
21108+ CompilerError.throwDiagnostic({
21109+ severity: ErrorSeverity.UnsupportedJS,
21110+ category: ErrorCategory.UnsupportedSyntax,
21111+ reason: '`this` is not supported syntax',
21112+ description: 'React Compiler does not support compiling functions that use `this`',
21113+ details: [
21114+ {
21115+ kind: 'error',
21116+ message: '`this` was used here',
21117+ loc: (_b = node.loc) !== null && _b !== void 0 ? _b : GeneratedSource,
21118+ },
21119+ ],
21120+ });
21121+ }
2110721122 const originalName = node.name;
2110821123 let name = originalName;
2110921124 let index = 0;
@@ -21121,7 +21136,7 @@ class HIRBuilder {
2112121136 },
2112221137 scope: null,
2112321138 type: makeType(),
21124- loc: (_b = node.loc) !== null && _b !== void 0 ? _b : GeneratedSource,
21139+ loc: (_c = node.loc) !== null && _c !== void 0 ? _c : GeneratedSource,
2112521140 };
2112621141 __classPrivateFieldGet(this, _HIRBuilder_env, "f").programContext.addNewReference(name);
2112721142 __classPrivateFieldGet(this, _HIRBuilder_bindings, "f").set(name, { node, identifier });
0 commit comments