I'm not sure if this is a bug or not but I figured I'd pose the question here. I'm trying to adjust my coding to match suggestions in the guide so I am trying to reduce my System.getModule calls. It seems like the module does not get included in a package if I set a variable in a scriptable task to just the module or if I set an attribute to the module. I'd expect the package compiler to grab the whole module and include it in the package when I do this but that is not happening. Is this expected behavior or a bug? Seems like a bug to me.
This is the expected behavior of the current code, although it could also be considered a bug.
The code that scans scripting content to determine what elements are referenced scans for a pattern matching System.getModule("someModuleName").someAction(args) and, if found, adds the action someAction to the package. It doesn't detect System.getModule("someModuleName") pattern and hence doesn't add all actions from this module to the package.
This also means that the following pattern won't detect someAction as being referenced:
var module = System.getModule("someModuleName");
module.someAction(args);
The problem is that the reference scanner is not a proper Javascript language parser and doesn't recognize many valid Javascript constructs.
This is the expected behavior of the current code, although it could also be considered a bug.
The code that scans scripting content to determine what elements are referenced scans for a pattern matching System.getModule("someModuleName").someAction(args) and, if found, adds the action someAction to the package. It doesn't detect System.getModule("someModuleName") pattern and hence doesn't add all actions from this module to the package.
This also means that the following pattern won't detect someAction as being referenced:
var module = System.getModule("someModuleName");
module.someAction(args);
The problem is that the reference scanner is not a proper Javascript language parser and doesn't recognize many valid Javascript constructs.
Thanks for the info. Thats good to know! I can work with that to make sure all actions get pulled in.