google / google/closure-compiler

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

Open
#4,182 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

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)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.