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

eshost fails inscrutably when the file starts with a string literal #115

Open
bakkot opened this issue Oct 15, 2021 · 0 comments
Open

eshost fails inscrutably when the file starts with a string literal #115

bakkot opened this issue Oct 15, 2021 · 0 comments

Comments

@bakkot
Copy link

bakkot commented Oct 15, 2021

Create a file tmp.js containing 'a|b'.split('|').forEach(print), then run eshost tmp.js (assuming the existence of eshost-cli). On my machine, at least, this produces output along the lines of

#### Chakra

SyntaxError: Expected ';'

#### engine262

SyntaxError: Unexpected token

#### GraalJS

SyntaxError: f-1634278503297-82335-eko3b0.sec9l.js:1:5 Expected ; but found const

#### Hermes

SyntaxError: ';' expected

#### JavaScriptCore

SyntaxError: Unexpected keyword 'const'. Parse error.

#### SpiderMonkey

SyntaxError: unexpected token: keyword 'var':

#### V8

SyntaxError: Unexpected token 'var'

#### XS

SyntaxError: missing ;

Poking around some, it looks like the problem is that it's attempting to inject the header with a regex which matches '', i.e., it is trying to insert the header between the '' and the .split, which obviously isn't going to work.

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

No branches or pull requests

1 participant