Skip to content

Commit 959e17a

Browse files
author
Cédric Belin
committed
Code optimization
1 parent 315086a commit 959e17a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/fast_transformer.coffee

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ export class FastTransformer
3535

3636
# Processes a PHP script.
3737
transform: (file) ->
38-
await @listen()
39-
url = new URL "http://127.0.0.1:#{@_port}/index.php"
38+
port = await @listen()
39+
url = new URL "http://127.0.0.1:#{port}/index.php"
4040
url.searchParams.set "file", resolve(file)
4141

4242
response = await fetch url
4343
throw Error("An error occurred while processing the script: #{file}") unless response.ok
44-
response.text()
44+
await response.text()
4545

4646
# Gets an ephemeral TCP port chosen by the system.
4747
_getPort: -> new Promise (fulfill, reject) ->

0 commit comments

Comments
 (0)