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

Unexpected rename destructed property data to input #2254

Open
FiodorGherasimenco opened this issue Jun 24, 2024 · 0 comments · May be fixed by #2257
Open

Unexpected rename destructed property data to input #2254

FiodorGherasimenco opened this issue Jun 24, 2024 · 0 comments · May be fixed by #2257
Assignees
Labels
type:bug A bug report

Comments

@FiodorGherasimenco
Copy link

Marko Translator Default: 6.0.5

Details

Destructing params width property data for tags await or macros cause unexpected rename from data to input.

<await(Promise.resolve({data: true}))>
 <@then|{data}|>
  $ console.log(data)
 </@then>
</await>
<macro|{data}| name="custom-tag">
  $ console.log(data)
</macro>

<custom-tag data=true>

Expected Behavior

const _marko_componentType$3 = "v+ir3NBW",
  _marko_template$3 = t(_marko_componentType$3);
const _marko_component$3 = {};
_marko_template$3._ = _marko_renderer$1(
  function (input, out, _componentDef, _component, state, $global) {
    _marko_tag(
      _await,
      i(
        () => {
          a("then", {
            renderBody: (out, { data }) => {
              console.log(data);
            },
          });
        },
        {
          _provider: Promise.resolve({
            data: true,
          }),
          _name: "Promise.resolve({\n  data: true\n})",
        }
      ),
      out,
      _componentDef,
      "0"
    );
  },
  {
    t: _marko_componentType$3,
    i: true,
  },
  _marko_component$3
);
const _marko_componentType$9 = "q9e2IxLW",
  _marko_template$9 = t(_marko_componentType$9);
const _marko_component$9 = {};
_marko_template$9._ = _marko_renderer$2(
  function (input, out, _componentDef, _component, state, $global) {
    function _abc(out, { data }) {
      console.log(data);
    }
    _marko_dynamic_tag$1(
      out,
      _abc,
      () => ({
        data: true,
      }),
      null,
      null,
      null,
      _componentDef,
      "1"
    );
  },
  {
    t: _marko_componentType$9,
    i: true,
  },
  _marko_component$9
);

Actual Behavior

const _marko_componentType$3 = "v+ir3NBW",
  _marko_template$3 = t(_marko_componentType$3);
const _marko_component$3 = {};
_marko_template$3._ = _marko_renderer$1(
  function (input, out, _componentDef, _component, state, $global) {
    _marko_tag(
      _await,
      i(
        () => {
          a("then", {
            renderBody: (out, { data }) => {
              console.log(input);
            },
          });
        },
        {
          _provider: Promise.resolve({
            data: true,
          }),
          _name: "Promise.resolve({\n  data: true\n})",
        }
      ),
      out,
      _componentDef,
      "0"
    );
  },
  {
    t: _marko_componentType$3,
    i: true,
  },
  _marko_component$3
);
const _marko_componentType$9 = "q9e2IxLW",
  _marko_template$9 = t(_marko_componentType$9);
const _marko_component$9 = {};
_marko_template$9._ = _marko_renderer$2(
  function (input, out, _componentDef, _component, state, $global) {
    function _abc(out, { data }) {
      console.log(input);
    }
    _marko_dynamic_tag$1(
      out,
      _abc,
      () => ({
        data: true,
      }),
      null,
      null,
      null,
      _componentDef,
      "1"
    );
  },
  {
    t: _marko_componentType$9,
    i: true,
  },
  _marko_component$9
);
@FiodorGherasimenco FiodorGherasimenco added the type:unverified bug A bug report that has not been verified label Jun 24, 2024
@LuLaValva LuLaValva added type:bug A bug report and removed type:unverified bug A bug report that has not been verified labels Jun 24, 2024
@LuLaValva LuLaValva self-assigned this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants