@@ -227,9 +227,7 @@ private void validateTypedefs(Node n, JSDocInfo info) {
227
227
return ;
228
228
}
229
229
Node lvalue = NodeUtil .isNameDeclaration (n ) || n .isAssign () ? n .getFirstChild () : n ;
230
- // Static properties for goog.defineClass are rewritten to qualified names before typechecking
231
- // runs and are valid as @typedefs.
232
- if (!lvalue .isQualifiedName () && !isGoogDefineClassStatic (lvalue )) {
230
+ if (!lvalue .isQualifiedName ()) {
233
231
reportMisplaced (
234
232
n ,
235
233
"typedef" ,
@@ -242,14 +240,6 @@ private void validateTypedefs(Node n, JSDocInfo info) {
242
240
}
243
241
}
244
242
245
- /** Whether this is a property in this object: {@code goog.defineClass(superClass, {statics: {} */
246
- private boolean isGoogDefineClassStatic (Node n ) {
247
- return n .isStringKey ()
248
- && n .getParent ().isObjectLit ()
249
- && n .getGrandparent ().isStringKey ()
250
- && n .getGrandparent ().getString ().equals ("statics" );
251
- }
252
-
253
243
private void validateTemplates (Node n , JSDocInfo info ) {
254
244
if (info != null
255
245
&& !info .getTemplateTypeNames ().isEmpty ()
@@ -286,13 +276,6 @@ && getFunctionDecl(n) == null) {
286
276
return n .getLastChild ();
287
277
}
288
278
289
- if (n .isStringKey ()
290
- && n .getGrandparent () != null
291
- && ClosureRewriteClass .isGoogDefineClass (n .getGrandparent ())
292
- && n .getFirstChild ().isFunction ()) {
293
- return n .getFirstChild ();
294
- }
295
-
296
279
if (n .isGetterDef () || n .isSetterDef ()) {
297
280
return n .getFirstChild ();
298
281
}
@@ -389,13 +372,8 @@ private void validateAbstractJsDoc(Node n, JSDocInfo info) {
389
372
return ;
390
373
}
391
374
392
- // TODO(b/124020008): Delete this case when `goog.defineClass` is dropped.
393
- boolean isGoogDefineClassConstructor =
394
- n .getParent ().isObjectLit ()
395
- && (n .isMemberFunctionDef () || n .isStringKey ())
396
- && "constructor" .equals (n .getString ());
397
- if (NodeUtil .isEs6ConstructorMemberFunctionDef (n ) || isGoogDefineClassConstructor ) {
398
- // @abstract annotation on an ES6 or goog.defineClass constructor
375
+ if (NodeUtil .isEs6ConstructorMemberFunctionDef (n )) {
376
+ // @abstract annotation on an ES6 constructor
399
377
report (n , MISPLACED_ANNOTATION , "@abstract" , "constructors cannot be abstract" );
400
378
return ;
401
379
}
0 commit comments