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

Bug 493177

Summary: [tern18] The ordering of plugins loaded can affect file resolution
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, Olivier_Thomann
Version: unspecified   
Target Milestone: 12.0   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Rennie CLA 2016-05-06 20:13:40 EDT
Currently during our preParse phase we pre-emptively resolve dependency paths (good), but if you load all plugins (requirejs, node, commonjs, es_modules) it seems that non-relative paths from requirejs defines, can fail to be resolved. This is happening because the "node" flag is being set (when one of the other three plugins asks for a resolution) and we then think we are about to start a workspace lookup on a non-relative node path (which we don't do).

The easiest way to address this is to have each collected dependency state what env context we collected it from, so there is no longer a need for flags during the preParse resolution phase - we can simply pass the env type along with the read request to know what to do.
Comment 1 Michael Rennie CLA 2016-05-06 20:32:31 EDT
Fixed in: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=cde1d4c9be3afe93ffaf40263d7178edb318f81f

I also cleaned up our acorn plugin to avoid unnecessary object creation and remove the use of for..in.

Olivier, Curtis, please verify.