Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 464827

Summary: [tern] Uncaught type error from tern/acorn
Product: [ECD] Orion Reporter: Curtis Windatt <curtis.windatt.public>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Michael_Rennie
Version: 8.0   
Target Milestone: 9.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Curtis Windatt CLA 2015-04-16 14:31:47 EDT
Discovered while testing a massive file, but still get the error after reducing to:

(func

That's it, running content assist anywhere throws the two errors:

Uncaught TypeError: Cannot read property 'type' of nullc @ walk.js:60exports.recursive @ walk.js:62exports.analyze @ infer.js:1187(anonymous function) @ tern.js:224exports.withContext @ infer.js:659analyzeFile @ tern.js:220analyzeAll @ tern.js:331doRequest @ tern.js:199signal.mixin.request @ tern.js:141computeProposals @ ternAssistHandler.js:411onmessage @ ternWorker.js:94

Uncaught TypeError: Cannot read property 'type' of undefinedc @ walk.js:28skipThrough @ walk.js:163c @ walk.js:29base.ExpressionStatement @ walk.js:176c @ walk.js:29skipThrough @ walk.js:163c @ walk.js:29base.Program.base.BlockStatement @ walk.js:171c @ walk.js:29exports.simple @ walk.js:32postParse @ doc_comment.js:28runPasses @ infer.js:1155exports.parse @ infer.js:1174updateText @ tern.js:79ensureFile @ tern.js:246signal.mixin.addFile @ tern.js:115onmessage @ ternWorker.js:114
Comment 1 Michael Rennie CLA 2015-04-16 14:33:26 EDT
This is caused by the 'statement' property of the ExpressionStatement node being null (when it should be a RecoveredNode)
Comment 2 Curtis Windatt CLA 2015-04-16 14:38:51 EDT
(function (console, args, readFileFunc) {
  
};

There was another issue in the file causing a very similar stack trace, I reduced it to a mismatched bracket snippet.
Comment 4 Curtis Windatt CLA 2015-04-16 15:23:24 EDT
+1, works on my large test files as well as the snippets.