@@ -41,32 +41,23 @@ class PhantomJSEnv(
41
41
42
42
protected def vmName : String = " PhantomJS"
43
43
44
- override def jsRunner (libs : Seq [VirtualJSFile ],
45
- code : VirtualJSFile ): JSRunner = {
46
- new PhantomRunner (libs, code)
47
- }
44
+ override def jsRunner (files : Seq [VirtualJSFile ]): JSRunner =
45
+ new PhantomRunner (files)
48
46
49
- override def asyncRunner (libs : Seq [VirtualJSFile ],
50
- code : VirtualJSFile ): AsyncJSRunner = {
51
- new AsyncPhantomRunner (libs, code)
52
- }
47
+ override def asyncRunner (files : Seq [VirtualJSFile ]): AsyncJSRunner =
48
+ new AsyncPhantomRunner (files)
53
49
54
- override def comRunner (libs : Seq [VirtualJSFile ],
55
- code : VirtualJSFile ): ComJSRunner = {
56
- new ComPhantomRunner (libs, code)
57
- }
50
+ override def comRunner (files : Seq [VirtualJSFile ]): ComJSRunner =
51
+ new ComPhantomRunner (files)
58
52
59
- protected class PhantomRunner (libs : Seq [VirtualJSFile ],
60
- code : VirtualJSFile ) extends ExtRunner (libs, code)
61
- with AbstractPhantomRunner
53
+ protected class PhantomRunner (files : Seq [VirtualJSFile ])
54
+ extends ExtRunner (files) with AbstractPhantomRunner
62
55
63
- protected class AsyncPhantomRunner (libs : Seq [VirtualJSFile ],
64
- code : VirtualJSFile ) extends AsyncExtRunner (libs, code)
65
- with AbstractPhantomRunner
56
+ protected class AsyncPhantomRunner (files : Seq [VirtualJSFile ])
57
+ extends AsyncExtRunner (files) with AbstractPhantomRunner
66
58
67
- protected class ComPhantomRunner (libs : Seq [VirtualJSFile ],
68
- code : VirtualJSFile ) extends AsyncPhantomRunner (libs, code)
69
- with ComJSRunner {
59
+ protected class ComPhantomRunner (files : Seq [VirtualJSFile ])
60
+ extends AsyncPhantomRunner (files) with ComJSRunner {
70
61
71
62
private var mgrIsRunning : Boolean = false
72
63
@@ -403,9 +394,8 @@ class PhantomJSEnv(
403
394
out.write(s """ <html><head>
404
395
<title>Phantom.js Launcher</title>
405
396
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> """ )
406
- sendJS(getLibJSFiles(), out)
407
- writeCodeLauncher(code, out)
408
- out.write(s " </head> \n <body onload=' $launcherName()'></body> \n </html> \n " )
397
+ sendJS(getJSFiles(), out)
398
+ out.write(s " </head> \n <body></body> \n </html> \n " )
409
399
}
410
400
411
401
protected def createTmpLauncherFile (): File = {
@@ -486,17 +476,6 @@ class PhantomJSEnv(
486
476
487
477
webTmpF
488
478
}
489
-
490
- protected def writeCodeLauncher (code : VirtualJSFile , out : Writer ): Unit = {
491
- // Create a file with the launcher function.
492
- val launcherFile = new MemVirtualJSFile (" phantomjs-launcher.js" )
493
- launcherFile.content = s """
494
- // Phantom.js code launcher
495
- // Origin: ${code.path}
496
- function $launcherName() { ${code.content}}
497
- """
498
- writeJSFile(launcherFile, out)
499
- }
500
479
}
501
480
502
481
protected def htmlEscape (str : String ): String = str.flatMap {
@@ -513,6 +492,4 @@ private object PhantomJSEnv {
513
492
private final val MaxByteMessageSize = 32768 // 32 KB
514
493
private final val MaxCharMessageSize = MaxByteMessageSize / 2 // 2B per char
515
494
private final val MaxCharPayloadSize = MaxCharMessageSize - 1 // frag flag
516
-
517
- private final val launcherName = " scalaJSPhantomJSEnvLauncher"
518
495
}
0 commit comments