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

Support object literals #39

Closed
egucciar opened this issue Mar 21, 2016 · 3 comments
Closed

Support object literals #39

egucciar opened this issue Mar 21, 2016 · 3 comments

Comments

@egucciar
Copy link

An expression with object-literal is not supported. E.g.

{ object: 'Literal' }

How come?

@LeaVerou
Copy link
Collaborator

Probably because JSEP parses a subset of JS (remember it stands for JavaScript Expression Parser). Now, what constitutes expressions is debatable. I think we can all agree that a + b is an expression and function(a) { return a + 1 } is not. However, there is a lot in between that could be argued either way, and I think object literals fall in this gray area.

I, for one, do see value in supporting them. They would be pretty useful as operands in expressions. It's also the only part of JSON That jsep cannot parse, fwiw. I’m not sure what @EricSmekens thinks though.

@LeaVerou LeaVerou changed the title Objects not supported Support object literals Sep 18, 2017
@josh-hemphill
Copy link

Any news on this since 2017? Would pull requests for this be welcome? If the maintainers are good with it, I'd love to take a crack at it since this would be so useful.

@EricSmekens
Copy link
Owner

Would be definitely welcome!

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

No branches or pull requests

5 participants