When writing an "internal" function - it is possible to inject a catalog compiler or a script compiler such that it is given to the method called by a dispatcher. This does however only work when a function is called for a compilation that was initiated using PAL. That is bad because it is very useful to be able to get the current compiler. While it is available, the way in it is obtained, as well as the exposure to implementation details is not great. In contrast the interfaces that are returned as a CatalogCompiler and a ScriptCompiler using the PAL APIs are designed to have only API methods. It should be a simple fix to make sure that a Catalog/Script compiler is obtained also when compilation is initiated through other means than PAL. Se also PUP-8594 regarding specification needed for the 4.x API. |