Skip to content

Commit

Permalink
Code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Dec 6, 2024
1 parent 315086a commit 959e17a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fast_transformer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export class FastTransformer

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

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

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

0 comments on commit 959e17a

Please sign in to comment.