Semgrep: javascript AST generic generation error: void 0

Created on 17 Apr 2020  路  2Comments  路  Source: returntocorp/semgrep

apparently

if (x === void 0) { // parse error here
            // 
}

is valid Javascript. Who knew? https://stackoverflow.com/questions/7452341/what-does-void-0-mean

sgrep currently throws an AstGenericError for this case

https://sgrep.live/zZW

bug javascript medium

Most helpful comment

@DrewDennison I just checked and it looks like we pass all those cases.

All 2 comments

https://github.com/denysdovhan/wtfjs is a good source of test cases / patterns we should write

@DrewDennison I just checked and it looks like we pass all those cases.

Was this page helpful?
0 / 5 - 0 ratings