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

Execute Javascript documentation issue #244

Closed
ombre42 opened this issue Oct 21, 2013 · 3 comments
Closed

Execute Javascript documentation issue #244

ombre42 opened this issue Oct 21, 2013 · 3 comments

Comments

@ombre42
Copy link
Contributor

ombre42 commented Oct 21, 2013

The documentation says "code may contain multiple lines of code but must contain a return statement (with the value to be returned) at the end."

This should be re-worded to reflect that the keyword has a return value of None unless you have a return statement at the end of the script. A return statement is not a "must".

@ombre42 ombre42 modified the milestones: 1.7, 1.6 Aug 29, 2014
@ombre42 ombre42 closed this as completed Aug 29, 2014
@gjemp
Copy link

gjemp commented Oct 8, 2014

sry for commenting this but I was really confused with returning value.
was trying following:

  1. function a(){ var b = 1; return b;}
  2. function a(){ var b = 1; return b;} return a();

were not working and then I tried this:

  1. return b=1;
    and it worked. But in JS you can return something only in function so I was expecting that if functions returns something then that is it :)
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return

The return statement ends function execution and specifies a value to be returned to the function caller.

Example of returning anything should be shown as( this is working at the moment :D ) : Execute Javascript return a=1+1

@ombre42
Copy link
Contributor Author

ombre42 commented Oct 8, 2014

Sounds like we need more clarification.
Add this text (from the Javadocs for Se): The script fragment provided will be executed as the body of an anonymous function.
Add an example with a return statement to both execute keywords.

@ombre42 ombre42 reopened this Oct 8, 2014
@ombre42
Copy link
Contributor Author

ombre42 commented Oct 9, 2014

@gjemp I updated per my comments above - see d993370.

FYI you can find more examples in this Javadoc

@ombre42 ombre42 closed this as completed Oct 9, 2014
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