Skip to content

Error with unary expression #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tgfjt opened this issue Dec 8, 2015 · 1 comment
Closed

Error with unary expression #4

tgfjt opened this issue Dec 8, 2015 · 1 comment

Comments

@tgfjt
Copy link

tgfjt commented Dec 8, 2015

Thank you for your gulp-unassert!

I'm not sure that unassert's responsible for this issue, but I record.

This is a minimum sample to occur the error.

function add (a, b) {
    !console.assert(a)
    return a + b;
}

Error:

/Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:2421
        type = expr.type || Syntax.Property;
                   ^

TypeError: Cannot read property 'type' of null
    at CodeGenerator.generateExpression (/Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:2421:20)
    at CodeGenerator.Statement.ExpressionStatement (/Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:1321:28)
    at CodeGenerator.generateStatement (/Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:2440:33)
    at /Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:1078:51
    at withIndent (/Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:582:9)
    at CodeGenerator.Statement.BlockStatement (/Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:1028:13)
    at CodeGenerator.generateStatement (/Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:2440:33)
    at CodeGenerator.maybeBlock (/Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:837:33)
    at CodeGenerator.generateFunctionBody (/Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:955:30)
    at CodeGenerator.Statement.FunctionDeclaration (/Users/tgfjt/workspace/unassert-sample/node_modules/escodegen/escodegen.js:1733:22)

I got this error through JS includes jQuery.
e.g. https://github.com/jquery/jquery/blob/5c4be05d3b32456553dc944853b77fa96ae8b2b8/external/sizzle/dist/sizzle.js#L2155

Thanks!

@twada
Copy link
Member

twada commented Dec 8, 2015

@tgfjt Thank you for using unassert, thank you for reporting, and thank you for creating minimal reproduction case.

Yes, this is a bug. I'll fix it ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants