是否可以使用checkstyle检测实例类型?例如,我有像这样的代码块 class A { .... }
} 在本例中,我希望获得MyCustomException的真实实例。我知道我们可以在自定义插件中使用TokenTypes.LITERAL_NEW,但在这种情况下,我只能获得异常的名称,而不能获得实例类型(我没有这个异常类型的地址)。
我只是在玩弄instanceof操作符。我想知道我的理解是否正确。__proto__ is points to C.prototype. that means inheriting from C.prototype.//instanceof will check o1.C.prototype = {};
console.log(o1 instanceof C) // fals