Using include to start the debugger
This commit is contained in:
parent
bf538745d7
commit
01829b04d7
|
@ -1,26 +1,9 @@
|
|||
startDebugger = function () {
|
||||
|
||||
var runnable = {
|
||||
run: function () {
|
||||
main.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var context = Packages.org.mozilla.javascript.Context.getCurrentContext(); // Within the current context...
|
||||
var contextFactory = context.getFactory();
|
||||
var scope = Packages.org.mozilla.javascript.tools.shell.Environment(runnable.__parent__); // and the scope of the runnable variable's parent ...
|
||||
var main = Packages.org.mozilla.javascript.tools. debugger.Main.mainEmbedded(contextFactory, scope, 'Debugger'); // start a debugging session ...
|
||||
main.setExitAction(java.lang.Runnable(runnable)); // , clean the resources at exit time...
|
||||
main.setVisible(true); // and make it visible/
|
||||
|
||||
}
|
||||
|
||||
include = function (filepath, isAbsolute) {
|
||||
if (isAbsolute === undefined || isAbsolute == false) {
|
||||
filepath = Packages.ro.sync.ecss.extensions.commons.operations.CommonsOperationsUtil.expandAndResolvePath(authorAccess, filepath);
|
||||
}
|
||||
var text = new java.lang.String(java.nio.file.Files.readAllBytes(java.nio.file.Paths.get('/home/vdv/projects/tea/dyomedea/ramblings/oxygen/js-debugger-importer/test.js')));
|
||||
}
|
||||
Packages.java.lang.System.out.println('filepath: ' + filepath );
|
||||
var text = new java.lang.String(java.nio.file.Files.readAllBytes(java.nio.file.Paths. get (java.net.URI(filepath))));
|
||||
text = String(text);
|
||||
eval(text);
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
startDebugger = function () {
|
||||
|
||||
var runnable = {
|
||||
run: function () {
|
||||
main.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var context = Packages.org.mozilla.javascript.Context.getCurrentContext();
|
||||
// Within the current context...
|
||||
var contextFactory = context.getFactory();
|
||||
var scope = Packages.org.mozilla.javascript.tools.shell.Environment(runnable.__parent__);
|
||||
// and the scope of the runnable variable's parent ...
|
||||
var main = Packages.org.mozilla.javascript.tools. debugger.Main.mainEmbedded(contextFactory, scope, 'Debugger');
|
||||
// start a debugging session ...
|
||||
main.setExitAction(java.lang.Runnable(runnable));
|
||||
// , clean the resources at exit time...
|
||||
main.setVisible(true);
|
||||
// and make it visible/
|
||||
}
|
|
@ -794,7 +794,11 @@
|
|||
<serializableOrderedMap>
|
||||
<entry>
|
||||
<String>script</String>
|
||||
<String>doOperation = startDebugger;</String>
|
||||
<String>doOperation = function () {
|
||||
include('debugger.js');
|
||||
startDebugger();
|
||||
}
|
||||
</String>
|
||||
</entry>
|
||||
</serializableOrderedMap>
|
||||
</field>
|
||||
|
|
Loading…
Reference in New Issue