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

Fails to serialize certain functions using serializeFunction in the template #8779

Closed
rchl opened this issue Feb 6, 2021 · 0 comments · Fixed by #8780
Closed

Fails to serialize certain functions using serializeFunction in the template #8779

rchl opened this issue Feb 6, 2021 · 0 comments · Fixed by #8780

Comments

@rchl
Copy link

rchl commented Feb 6, 2021

Versions

  • nuxt: v2.14.12
  • node: v14

Reproduction

https://codesandbox.io/s/serializefunction-bug-3elqy?file=/pages/index.vue

Steps to reproduce

From a template, call

<%
const obj = {
  fn () { const x = rule => rule }
};
const serialized = serializeFunction(obj.fn)
%>
<%= serialized %>

What is Expected?

That the serialized function starts with a function keyword.

What is actually happening?

The serialized function starts with a fn identifier.

@rchl rchl added the bug-report label Feb 6, 2021
@rchl rchl changed the title Template to serialize function with space before function arguments Fails to serialize certain functions using serializeFunction template function Feb 6, 2021
@rchl rchl changed the title Fails to serialize certain functions using serializeFunction template function Fails to serialize certain functions using serializeFunction in the template Feb 6, 2021
@pi0 pi0 closed this as completed in #8780 Feb 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants