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
Dartium enabled Console (dev tools) #1406
Comments
Since each Dart script runs in a new isolate, with its own global state, it is not really helpful (or meaningful) to run Dart code one statement at a time, from the console. There is, in principle, no way of adding code to a running isolate. Unless we introduced new semantics for compiling new lines and adding them to a script, all of the effects of a single Dart statement would be confined to the new isolate running that line (and the DOM state).. The least intrusive way to add code to an existing isolate in the debugger would, I suppose, be to add a new top-level function, and then call that function. But I doubt this is that useful. I think most of the use case for running Dart code at the console is med by tools that would allow objects to be inspected and changed, and would let you step through an existing script, and let you get to the code you want to test using breakpoints and watchpoints. It isn't clear if you are referring to dev tools running the javascript code, that was produced by the dart comipler, or to dev tools running on dartium, so I'm not sure what aread this belongs in. Removed Type-Defect label. |
Removed Area-UI label. |
This comment was originally written by antonm@google.com Added this to the Later milestone. |
This comment was originally written by @bgourlie wheese's response makes it apparent why this is not trivially implemented, but I think it's vastly important to accommodate this considering it is something that can be done in javascript, and it would be taking a step back if I were unable to do so. For my particular use case, I just want to call methods on globally defined objects within a particular isolate -- I don't want to redefine them or add new code. Of course, I don't know if this makes the solution any more trivial, or is universally useful enough to implement in this limited fashion. |
This comment was originally written by antonm@google.com Set owner to podivilov@google.com. |
This comment was originally written by dbro...@gmail.com I am new to Dart so let me know if I am mistaken here, but it seems to me that simply being able to interact with the DOM through the console would be immensely helpful. I don’t need to be able to interact with running code (other than indirectly). |
This comment was originally written by dbrockman...@gmail.com Hmm, perhaps I misunderstood what was said earlier about isolates. I guess you are saying that I wouldn’t for example be able to define a variable on one line in the console, and then use that variable on the next line? |
Set owner to @jacob314. |
This should be implemented with Jacob's CL: https://codereview.chromium.org/23710032/ Removed this from the Later milestone. |
This is fixed as of Dart release 0.8.1.2 . Added Fixed label. |
This comment was originally written by bangkok...@gmail.com as of download from 2013/11/19, do not think it works
if included file has nothing but
|
Make sure the context of the console is set to Dart not the JS context. You can verify that Dart code is running by writing the following two separate lines in the console: You should see |
This comment was originally written by bangko...@gmail.com very good info. this would be most useful in |
This comment was originally written by bangko...@gmail.com two issues:
|
This comment was originally written by bangko...@gmail.com cannot declare a ==> "'': Error: line 2 pos 1: unexpected token 'class' is there some special syntax here, like having to declare variables with |
Sorry defining classes from the console is not supported at this time. var bar = (foo) { print("Hello $foo"); return ()=> 42;} |
This issue was originally filed by krhebba...@gmail.com
It would be nice if we can run dart code directly from Dartium console.
The text was updated successfully, but these errors were encountered: