closure-compiler icon indicating copy to clipboard operation
closure-compiler copied to clipboard

Can't use goog.reflect.object/objectProperty from es6 module.

Open ribrdb opened this issue 1 year ago • 2 comments

I see that objectProperty and object are available in closure-compiler/lib/reflect.js. However I do not see any way to use these from an es6 module. I tried adding these to goog.js and using it like this:

import * as goog from 'goog.js'
const x = goog.reflect.objectProperty(...)

However goog.js only seems to work with properties of goog itself, not two-levels deep. I end up with an ast like (GETPROPERTY objectProperty (NAME goog$reflect)), but the isPropertyRenameFunction method only allows one of these:

(NAME JSCompiler_renameProperty)
(GETPROP objectProperty (GETPROP reflect (NAME goog)))
(NAME goog$reflect$objectProperty)

ribrdb avatar Jul 25 '24 15:07 ribrdb