@@ -2143,6 +2143,9 @@ RUN set -euxo pipefail; \
2143
2143
# stream.stream_ops is sometimes undefined and the check fails. Let's adjust it to
2144
2144
# tolerate a null stream.stream_ops value.
2145
2145
/root/replace.sh "s/if\s *\( stream\. stream_ops\. poll\) /if (stream.stream_ops?.poll)/g" /root/output/php.js; \
2146
+ # Emscriptend allows only directories to be mounted, but in Playground we support mounting files, directories, and symlinks.
2147
+ # For file mounting to work, we need to remove the directory check.
2148
+ /root/replace-across-lines.sh 's/(\s +)if\s *\(\s *!FS\. isDir\( node\. mode\)\s *\)\s *\{\s +throw\s +new\s +FS\. ErrnoError\( 54\)\s *;\s +\} (\s +)/$1$2/gs' /root/output/php.js; \
2146
2149
# Make Emscripten websockets configurable
2147
2150
# Emscripten makes the Websocket proxy connect to a fixed URL.
2148
2151
# This assumes the traffic is always forwarded to the same target.
@@ -2153,9 +2156,9 @@ RUN set -euxo pipefail; \
2153
2156
# Enable custom WebSocket constructors to support socket options.
2154
2157
/root/replace.sh "s/ws\s *=\s *new WebSocketConstructor/if (Module['websocket']['decorator']) {WebSocketConstructor = Module['websocket']['decorator'](WebSocketConstructor);}ws = new WebSocketConstructor/g" /root/output/php.js && \
2155
2158
if [ "$EMSCRIPTEN_ENVIRONMENT" = "node" ]; then \
2156
- if [ "$WITH_WS_NETWORKING_PROXY" = "yes" ]; then \
2157
- /root/replace.sh "s/sock\. server\s *=\s *new WebSocketServer/if (Module['websocket']['serverDecorator']) {WebSocketServer = Module['websocket']['serverDecorator'](WebSocketServer);}sock.server = new WebSocketServer/g" /root/output/php.js; \
2158
- fi; \
2159
+ if [ "$WITH_WS_NETWORKING_PROXY" = "yes" ]; then \
2160
+ /root/replace.sh "s/sock\. server\s *=\s *new WebSocketServer/if (Module['websocket']['serverDecorator']) {WebSocketServer = Module['websocket']['serverDecorator'](WebSocketServer);}sock.server = new WebSocketServer/g" /root/output/php.js; \
2161
+ fi; \
2159
2162
fi; \
2160
2163
# Add MSG_PEEK flag support in recvfrom
2161
2164
#
0 commit comments