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

boundEval of "a string" returns undefined #98

Open
JensLincke opened this issue May 4, 2017 · 5 comments
Open

boundEval of "a string" returns undefined #98

JensLincke opened this issue May 4, 2017 · 5 comments

Comments

@JensLincke
Copy link
Contributor

but it should eval to "a string"
observed in workspace and in direct usage

3 +"a string" eval correctly to "3a string"

@JensLincke
Copy link
Contributor Author

JensLincke commented May 4, 2017

@onsetsu any ideas?

@onsetsu
Copy link
Contributor

onsetsu commented May 18, 2017

Having a single String in a file is actually interpreted as a directive, e.g. used to activate strict mode:

"use strict";

We could recognize such cases explicitly during transpilation.

@onsetsu
Copy link
Contributor

onsetsu commented May 18, 2017

I also found that simply evaluating {a:1} returns undefined rather than the expected object.

Maybe there is a deeper problem with literals.

@JensLincke
Copy link
Contributor Author

({a:1}) seems to be fine
and ("hello") works also fine.

those two cases are relatively important during interactive workspace sessions....

@onsetsu
Copy link
Contributor

onsetsu commented Sep 11, 2019

I also found that simply evaluating {a:1} returns undefined rather than the expected object.

Maybe there is a deeper problem with literals.

Well, actually this is not an ObjectExpression but a BlockStatement with a LabelStatement.

So it returns undefined.

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

2 participants