forked from soliton4/nodeMirror
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptWgt.js
More file actions
130 lines (112 loc) · 3.11 KB
/
Copy pathScriptWgt.js
File metadata and controls
130 lines (112 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
define([
"dojo/_base/declare"
, "dojo/Deferred"
, "dojo/has"
, "sol/promise"
, "dojo/_base/array"
, "dojo/_base/lang"
, "sol/string"
, "./mode"
, "modules/contentTabs/tabMixin"
, "dijit/layout/BorderContainer"
, "main/codemirror/childMixin"
, "dijit/Toolbar"
, "dijit/form/Button"
, "sol/fileName"
], function(
declare
, Deferred
, has
, solPromise
, array
, lang
, solString
, debugMode
, tabMixin
, BorderContainer
, codeMirrorChildMixin
, MenuBar
, Button
, fileName
){
return declare([BorderContainer, codeMirrorChildMixin, tabMixin], {
"class": "debug javascript debugScriptWidget"
, gutters: false
, buildRendering: function(){
var ret = this.inherited(arguments);
this.menu = this.ownObj(new MenuBar({
region: "top"
}));
this.addChild(this.menu);
this.continueBtn = this.ownObj(new Button({
onClick: lang.hitch(this, "_continue", undefined)
, label: "continue"
}));
this.menu.addChild(this.continueBtn);
this.stepInBtn = this.ownObj(new Button({
onClick: lang.hitch(this, "_continue", "in")
, label: "step in"
}));
this.menu.addChild(this.stepInBtn);
this.stepNextBtn = this.ownObj(new Button({
onClick: lang.hitch(this, "_continue", "next")
, label: "next"
}));
this.menu.addChild(this.stepNextBtn);
this.stepOutBtn = this.ownObj(new Button({
onClick: lang.hitch(this, "_continue", "out")
, label: "step out"
}));
this.menu.addChild(this.stepOutBtn);
this.mirror.set("value", this.source.source);
this.set("title", fileName.single(this.source.name));
this.set("tooltip", this.source.name);
return ret;
}
, setBreakPoint: function(bp, exception){
this.mirror.set("mode", {
name: "debugging"
, line: bp.line
, col: bp.column
, length: bp.sourceLineText.length - bp.column
, exception: exception
});
this.mirror.setCursor({
line: bp.line,
ch: bp.column
});
}
, _continue: function(parStep){
this.debuggerObj.cont(parStep);
}
, constructor: function(par){
this.promise = new Deferred();
this.debuggerObj = par.debuggerObj;
this.script = par.script;
this.content = {
text: "loading code ..."
};
/*this.debuggerObj.getSource(this.script).then(lang.hitch(this, function(par){
this.mirror.set("value", par.source);
this.promise.resolve(this);
}));*/
}
, breakPoint: function(parData){
/*
invocationText: "#<Server>.[anonymous](req=#<IncomingMessage>, res=#<ServerResponse>)"
script: Object
sourceColumn: 2
sourceLine: 3
sourceLineText: " debugger;"
__proto__: Object
*/
//debugger;
this.mirror.set("mode", {
name: "debugging"
, line: parData.sourceLine
, col: parData.sourceColumn
, length: parData.sourceLineText.length - parData.sourceColumn
});
}
});
});