Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aexpr should keep Object.defineProperty config an object #396

Open
JensLincke opened this issue Nov 19, 2019 · 3 comments
Open

aexpr should keep Object.defineProperty config an object #396

JensLincke opened this issue Nov 19, 2019 · 3 comments

Comments

@JensLincke
Copy link
Contributor

Object.defineProperty(_recorder_.tempfile_js, 'expect', {
  get() {
    return expect;
  },

gets rewritten to:

Object.defineProperty(_recorder_._src_client_reactive_test_active_expression_proxies_active_expression_proxies_spec_js, 'expect', _wrap({

But it should be an Object, and a Proxy raised an error.

@niconomaa
Copy link
Contributor

out current approach leads to the object in the above mentioned example not being transformed, as specified.
in cases where the configuration object for defineProperty is not is not defined in the argument itself but rather represente with an identifier, our current approach still transform the object, as in the following example:

let config = {
  get() {
    return expect;
  }

Object.defineProperty(_recorder_.tempfile_js, 'expect', config)

@onsetsu
Copy link
Contributor

onsetsu commented Dec 9, 2019

@niconomaa Have you synced this functionality already?
@JensLincke can you check, whether this resolves our issue?

@niconomaa
Copy link
Contributor

@onsetsu yes

an alternative approach that we would like to discuss is, instead of checking an AST node's parent, checking "downwards" the AST from the CallExpression in question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants