@@ -36,30 +36,15 @@ class JSDOMNodeJSEnv(config: JSDOMNodeJSEnv.Config) extends JSEnv {
36
36
} catch {
37
37
case NonFatal (t) =>
38
38
JSRun .failed(t)
39
-
40
- case t : NotImplementedError =>
41
- /* In Scala 2.10.x, NotImplementedError was considered fatal.
42
- * We need this case for the conformance tests to pass on 2.10.
43
- */
44
- JSRun .failed(t)
45
39
}
46
40
}
47
41
48
42
def startWithCom (input : Input , runConfig : RunConfig ,
49
43
onMessage : String => Unit ): JSComRun = {
50
44
JSDOMNodeJSEnv .validator.validate(runConfig)
51
- try {
52
- ComRun .start(runConfig, onMessage) { comLoader =>
53
- val files = initFiles ::: (comLoader :: codeWithJSDOMContext(input))
54
- internalStart(files, runConfig)
55
- }
56
- } catch {
57
- case t : NotImplementedError =>
58
- /* In Scala 2.10.x, NotImplementedError was considered fatal.
59
- * We need this case for the conformance tests to pass on 2.10.
60
- * Non-fatal exceptions are already handled by ComRun.start().
61
- */
62
- JSComRun .failed(t)
45
+ ComRun .start(runConfig, onMessage) { comLoader =>
46
+ val files = initFiles ::: (comLoader :: codeWithJSDOMContext(input))
47
+ internalStart(files, runConfig)
63
48
}
64
49
}
65
50
@@ -111,31 +96,14 @@ class JSDOMNodeJSEnv(config: JSDOMNodeJSEnv.Config) extends JSEnv {
111
96
| throw error;
112
97
| });
113
98
|
114
- | /* Work around the fast that scalajsCom.init() should delay already
115
- | * received messages to the next tick. Here we cannot tell whether
116
- | * the receive callback is called for already received messages or
117
- | * not, so we dealy *all* messages to the next tick.
118
- | */
119
- | var scalajsCom = global.scalajsCom;
120
- | var scalajsComWrapper = scalajsCom === (void 0) ? scalajsCom : ({
121
- | init: function(recvCB) {
122
- | scalajsCom.init(function(msg) {
123
- | process.nextTick(recvCB, msg);
124
- | });
125
- | },
126
- | send: function(msg) {
127
- | scalajsCom.send(msg);
128
- | }
129
- | });
130
- |
131
99
| jsdom.env({
132
100
| html: "",
133
101
| url: "http://localhost/",
134
102
| virtualConsole: virtualConsole,
135
103
| created: function (error, window) {
136
104
| if (error == null) {
137
105
| window["__ScalaJSEnv"] = __ScalaJSEnv;
138
- | window["scalajsCom"] = scalajsComWrapper ;
106
+ | window["scalajsCom"] = global.scalajsCom ;
139
107
| } else {
140
108
| throw error;
141
109
| }
0 commit comments