Skip to content

issues with javascript expressions inside mustaches #139

Closed
@yeedle

Description

@yeedle

This might be an issue with the node version I'm using but I'm not sure.

Using an expression as follows works fine

{{ new Date($page.frontmatter.date) }}

However, if I pass the date as a string directly like so

{{ new Date("2017-05-08 09:50:00 EST") }}

the build fails. The error I get is that I should

  - avoid using JavaScript keyword as property name: "new"
  Raw expression: {{ new Date("2017-05-08 09:50:00 EST") }}

Do expressions not support passing arguments as strings to constructors?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions