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

Add support of Script.setScriptSource #5

Open
auchenberg opened this issue Apr 6, 2016 · 6 comments
Open

Add support of Script.setScriptSource #5

auchenberg opened this issue Apr 6, 2016 · 6 comments
Assignees

Comments

@auchenberg
Copy link
Contributor

Add support of setScriptSource, to enable projects like https://github.com/amokjs/amok to work with Edge.

@auchenberg auchenberg changed the title Add support of setScriptSource Add support of Script.setScriptSource Apr 6, 2016
@caspervonb
Copy link

caspervonb commented Apr 24, 2016

Quoting @andysterland from #16

The adapter doesn't yet implement them all but they are all on the short term to do list as the platform in Edge has the capabilities (though setScriptSource only works when not at a breakpoint).

Does this mean the following scenario will not work?

  • Set breakpoint at line 0 of myscript.js
  • Rewrite myscript.js with setScriptSource
  • Resume execution

This is somewhat key to the feature being useful, otherwise you'll get unreachable code in that it will have closures you cannot reach and missing captures.

@andysterland
Copy link
Member

@caspervonb you are correct.

Though with any live editing scenario, at a breakpoint or not, you can always get into a state that is nothing like would happen if the edit was applied and the page reloaded. Specifically changing the code doesn't' change the DOM nor does it reverse any affect the code had. Say, if you had a global function named foo and then deleted the code for it the function would still be there and could still be invoked. As you mention closures further complicate the matter :(.

But, you are very right the really useful scenario is when you hit an exception, spot the typo, change it and then set the statement (set statement is awesome!) back one and continue. Alas, it's just not supported in Chakra right now :(.

@caspervonb
Copy link

This is somewhat key to the feature being useful, otherwise you'll get unreachable code in that it will have closures you cannot reach and missing captures.

I was referring to an explicit case in my use case, which is basically rewrite scripts as they are parsed to inject instrumentation)


So to be clear, Chakra's edit and continue feature, cannot actually do edit and continue? What can it do then?

@nojvek
Copy link
Contributor

nojvek commented Jun 29, 2016

Chakra has edit on idle. Not edit and continue. They are working on having edit and continue but it requires a large refactor on their side to make it work.

@caspervonb
Copy link

So basically it takes effect on the next call rather than the current call stack?

@andysterland
Copy link
Member

@caspervonb exactly. The edit itself won't be carried out till the engine goes back to idle, that is the current stack finishes executing.

andysterland pushed a commit that referenced this issue Sep 11, 2017
Fix event load/unload and add main property to package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants