Community
Participate
Working Groups
},
/** @callback */
'no-undef-expression': function(context){
return {
/* @callback */
'MemberExpression': function(node){
if (node.property && node.object && node.object.type !== 'ThisExpression'){
if (node.parent && node.parent.type === 'CallExpression' && node.parent.callee && node.parent.callee === node){
var tern = context.getTern();
var propName = node.property.name ? node.property.name : node.property.value;
if (!propName) {
return;
}
var query = {start: node.property.start, end: node.property.end};
var expr = tern.findQueryExpr(tern.file, query);
if (!expr) {
// no expression found. No need to look for the type
);
});
it("Should not flag array access using a binary expression", function(callback) {
var topic = "var funcs = [], i = 5; return funcs[i - 1]();";
var config = { rules: {} };
config.rules[RULE_ID] = 1;
validate({buffer: topic, callback: callback, config: config}).then(
function (problems) {
assertProblems(problems, [
]);
function (error) {
worker.getTestState().callback(error);
//NO-UNDEF-INIT -------------------------------------------------
describe('no-unreachable', function() {