a compilation error and fix to submit

The one liner below in CubeAxesActor.js is causing compilation error when duplicated.

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

The compilation errors are

  Line 14:164:  Expected an assignment or function call and instead saw an expression  no-unused-expressions

I am not sure how it is compiled originally, but I made the following changes and it passes.

function ownKeys(object, enumerableOnly) { 
    var keys = Object.keys(object); 
    if (Object.getOwnPropertySymbols) { 
        var symbols = Object.getOwnPropertySymbols(object); 
        var symbol_filter = symbols.filter(
            function (sym) { 
                return Object.getOwnPropertyDescriptor(object, sym).enumerable; 
            }
        )
        if (enumerableOnly && (symbols == symbol_filter)) {
            keys.push.apply(keys, symbols); 
        }
        return keys;
    }
}

Hi,

Can you, please, put line breaks in your first code block? Posting readable code increases the probability of getting help.

thanks,

Paulo

Are you running eslint on node_modules? You shouldn’t be, otherwise you will get lots of unnecessary linting errors. ownKeys is from transpiling the vtk.js sources to ES5, and so is not actually part of the vtk.js codebase.