| Summary: | Detect the proper environment: node, commonjs, requirejs,... | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Olivier Thomann <Olivier_Thomann> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public, Michael_Rennie, Silenio_Quarti |
| Version: | 11.0 | ||
| Target Milestone: | 12.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 477377 | ||
|
Description
Olivier Thomann
The example is not valid requirejs - so we only think you are using node (the require call).
If however, you change the define call to be correct:
define("id", [], function() {})
or
define([], function() {})
then we tag the AST as AMD and node - which tells us that we need to treat this like commonjs and perform a workspace lookup on the required library.
(In reply to Michael Rennie from comment #1) > The example is not valid requirejs - so we only think you are using node > (the require call). I should have been more specific here - its not valid for us to compute dependencies - since a module with no id or dep array has none - see the docs about it: http://requirejs.org/docs/api.html#deffunc. This is where things get a bit confusing - define is being used, with no deps, so think it is not interesting, but for the sake of getting the commonjs env guessed correctly, it looks like we should care. Fix + tests: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=a8a1a8186f42914df280a80bbdf0a44241302cbe *** Bug 477377 has been marked as a duplicate of this bug. *** |