Class CheckPrototypeProperties

java.lang.Object
com.google.javascript.jscomp.lint.CheckPrototypeProperties
All Implemented Interfaces:
CompilerPass, NodeTraversal.Callback

public final class CheckPrototypeProperties extends Object implements CompilerPass, NodeTraversal.Callback
Checks when a mutable property is assigned to a prototype. This is generally undesirable because it can lead to the following unexpected situation.
 /** @constructor * /
 function MyClass() {}
 MyClass.prototype.prop = [];
 x = new MyClass;
 y = new MyClass;
 x.prop.push(1);
 console.log(y.prop) // [1]