lively4-core icon indicating copy to clipboard operation
lively4-core copied to clipboard

aexpr should keep Object.defineProperty config an object

Open JensLincke opened this issue 5 years ago • 3 comments

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.

JensLincke avatar Nov 19 '19 13:11 JensLincke

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)

niconomaa avatar Dec 09 '19 10:12 niconomaa

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

onsetsu avatar Dec 09 '19 11:12 onsetsu

@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

niconomaa avatar Dec 09 '19 11:12 niconomaa