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

Bug 527356

Summary: Trying to load a Tern definition that does not exist writes exception to the console
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 16.0   
Target Milestone: 17.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2017-11-16 10:41:36 EST
Consider the following .tern-project file contents:

{
  "plugins": {
    "node": true
  }, 
  "libs": ["ecma5", "ecma6", ".definitions/libz"],
  "ecmaVersion": 9
}

When this tries to load- and the def ".definitions/libz" does not exist - the following is written to the console:

Tern failed to reset: Cannot read property '!modules' of undefined
logger.js:26 TernError: Tern failed to reset: Cannot read property '!modules' of undefined
    at ternError (http://localhost:9846/tern/lib/tern.js:444:15)
    at new exports.Server (http://localhost:9846/tern/lib/tern.js:141:9)
    at startAndMessage (http://localhost:9846/javascript/plugins/ternWorkerCore.js:158:22)
    at http://localhost:9846/javascript/plugins/ternWorkerCore.js:172:11
    at settleDeferred (http://localhost:9846/orion/Deferred.js:70:28)
    at notify (http://localhost:9846/orion/Deferred.js:144:18)
    at run (http://localhost:9846/orion/Deferred.js:28:13)

We need to check the resolved array of definitions before simply passing them along to  #startServer