I have been experimenting with converting closure library to es6.
However, I can't seem to figure out a way to do this and still have the closure primitives be recognized by the compiler.
For example, isPropertyRenameFunction seems to want one of these things
(NAME JSCompiler_renameProperty)
(GETPROP objectProperty (GETPROP reflect (NAME goog)))
(NAME goog$reflect$objectProperty)
I can't figure out how to get any of these from an es6 module.
If I write something like this:
var JSCompiler_renameProperty = function(x) {
return x;
}
const fooieKey2 = JSCompiler_renameProperty("fooie");
I end up with a FUNCTION node for JSCompiler_renameProperty instead of a NAME node.
For object property I first tried this in goog/reflect/reflect.js
goog.declareModuleId('goog.reflect');
export function objectProperty(prop, object) {
return prop;
}
Bug again I get a FUNCTION node.
I also tried putting this into goog.js and importing that into my test module:
export const reflect = {
objectProperty(prop, object) {
return prop;
},
}
That seems to be closer, but now I get
(GETPROPERTY objectProperty (NAME goog$reflect))
Is there some way I can get this to work?