-
Notifications
You must be signed in to change notification settings - Fork 23
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 multi line commands (was: Input a scope in crconsole) #5
Comments
not sure if I get the idea. Are you talking about multi line input? |
Chrome dev tool's rule is multi line input. I think it's difficult to implement. |
multiline input would be tricky with repl/readline. Node starts 'multiline mode' when there is syntax error - see https://github.com/joyent/node/blob/master/lib/repl.js#L296 Not sure if that is desired behaviour at all. Maybe we should trigger this only by some errors, like "Unexpected end of input" |
OK, I got it. Thanks for your reply |
Feel free to try to implement it yourself :) |
I will try it:) |
I try to replace the eval function with the following code, but I am not sure that there is no bugs at that code. https://github.com/sidorares/crconsole/blob/master/index.js#L272
|
It will throw exceptions for some valid code, for example if you reference on the right hand side variable which is defined in remote context but not defined locally. I suggest to use esprima and check if it can build complete AST as a flag |
Oh!! Let me think about it. Thank you! |
I think it would be better if we can type a scope in crconsole.
Just like typing in chrome dev tool and chrome-remote-interface's repl.
The text was updated successfully, but these errors were encountered: