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

Comparison strings blow up if "return" is found #19

Open
searls opened this issue Dec 18, 2013 · 2 comments
Open

Comparison strings blow up if "return" is found #19

searls opened this issue Dec 18, 2013 · 2 comments

Comments

@searls
Copy link
Owner

searls commented Dec 18, 2013

Whatever regex we have hunting for the string "return" is apparently matching the last instance of return, so I have a test:

Then -> browser.executeScript("return 1 + 1;") === "yay!"

And the detected comparison is:

This comparison was detected:
  1 + 1;") === "yay!"
  <Error: "SyntaxError: Unexpected token ILLEGAL"> === yay!
   Stacktrace:
     Error: Then clause `browser.executeScript("return 1 + 1;") === "yay!"` failed by returning false

Obviously, that's not right. The regex is probably looking for the last return statement and should probably be looking for the first return statement on the last line.

@tandrewnichols
Copy link

Holy crap, I just spent like 2 hours trying to figure out why my browser.executeScript was reporting "Unexpected token ILLEGAL".

@tandrewnichols
Copy link

That should read: 👍

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

2 participants