-
Notifications
You must be signed in to change notification settings - Fork 81
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
NullReferenceException when using "protected" keywords as variable names #80
Comments
#94 which covers your |
Technically This might be hard to fix, depending on how well the async parsing has been implemented. We'll try though. PRs welcome! |
ok I've pushed a fix for the case you've found here, but there are other bugs remaining, namely
i.e. if you overload I don't know how to fix this without some serious rewriting of the parser, which I can't be arsed to do for such a sadistic case. |
Going to close this issue as its fixed, and i'll open a new one specific to the remaining case. see #130 |
Published 1.6.6 with a fix for this in |
I am minifying some npm packages and came across a failure when using multiple "protected" keywords as variable names.
JavaScript:
C#:
result = Uglify.Js(content, fileName: filePath);
Stacktrace:
NullReferenceException: Object reference not set to an instance of an object.
at NUglify.JavaScript.Syntax.MemberExpression.GetFunctionGuess(AstNode target) at NUglify.JavaScript.Syntax.BinaryExpression.GetFunctionGuess(AstNode target) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.GuessAtName(AstNode node) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(FunctionObject node) at NUglify.JavaScript.Syntax.FunctionObject.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(BinaryExpression node) at NUglify.JavaScript.Syntax.BinaryExpression.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(BlockStatement node) at NUglify.JavaScript.Syntax.BlockStatement.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(FunctionObject node) at NUglify.JavaScript.Syntax.FunctionObject.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(BlockStatement node) at NUglify.JavaScript.Syntax.BlockStatement.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(FunctionObject node) at NUglify.JavaScript.Syntax.FunctionObject.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.TreeVisitor.Visit(ObjectLiteralProperty node) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(ObjectLiteralProperty node) at NUglify.JavaScript.Syntax.ObjectLiteralProperty.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.TreeVisitor.Visit(AstNodeList node) at NUglify.JavaScript.Syntax.AstNodeList.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.TreeVisitor.Visit(ObjectLiteral node) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(ObjectLiteral node) at NUglify.JavaScript.Syntax.ObjectLiteral.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.TreeVisitor.Visit(VariableDeclaration node) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(VariableDeclaration node) at NUglify.JavaScript.Syntax.VariableDeclaration.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.TreeVisitor.Visit(VarDeclaration node) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(VarDeclaration node) at NUglify.JavaScript.Syntax.VarDeclaration.Accept(IVisitor visitor) at NUglify.JavaScript.Visitors.AnalyzeNodeVisitor.Visit(BlockStatement node) at NUglify.JavaScript.Syntax.BlockStatement.Accept(IVisitor visitor) at NUglify.JavaScript.JSParser.InternalParse() at NUglify.JavaScript.JSParser.Parse(DocumentContext sourceContext) at NUglify.Uglify.Js(String source, String fileName, CodeSettings codeSettings) at UserQuery.Minifiy(String filePath) at UserQuery.Main() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
The text was updated successfully, but these errors were encountered: