aboutsummaryrefslogtreecommitdiff
path: root/src/javascript/jsc/bindings/URLDecomposition.cpp
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-06-07 22:32:46 -0700
committerGravatar GitHub <noreply@github.com> 2022-06-07 22:32:46 -0700
commit43de33afc7fcc4cab25f578566e225ba9e4d4258 (patch)
tree141676095981741c3a5740093fee79ed12d4edcd /src/javascript/jsc/bindings/URLDecomposition.cpp
parent958fc3d4f5ba2a1fb5b5e1e2b9fe3a4500dbefc6 (diff)
downloadbun-43de33afc7fcc4cab25f578566e225ba9e4d4258.tar.gz
bun-43de33afc7fcc4cab25f578566e225ba9e4d4258.tar.zst
bun-43de33afc7fcc4cab25f578566e225ba9e4d4258.zip
Web Streams API (#176)
* [bun.js] `WritableStream`, `ReadableStream`, `TransformStream`, `WritableStreamDefaultController`, `ReadableStreamDefaultController` & more * Implement `Blob.stream()` * Update streams.test.js * Fix sourcemaps crash * [TextEncoder] 3x faster in hot loops * reading almost works * start to implement native streams * Implement `Blob.stream()` * Implement `Bun.file(pathOrFd).stream()` * Add an extra function * [fs.readFile] Improve performance * make jsc bindings a little easier to work with * fix segfault * faster async/await + readablestream optimizations * WebKit updates * More WebKit updates * Add releaseWEakrefs binding * `bun:jsc` * More streams * Update streams.test.js * Update Makefile * Update mimalloc * Update WebKit * Create bun-jsc.test.js * Faster ReadableStream * Fix off by one & exceptions * Handle empty files/blobs * Update streams.test.js * Move streams to it's own file * temp * impl #1 * take two * good enough for now * Implement `readableStreamToArray`, `readableStreamToArrayBuffer`, `concatArrayBuffers` * jsxOptimizationInlining * Fix crash * Add `jsxOptimizationInline` to Bun.Transpiler * Update Transpiler types * Update js_ast.zig * Automatically choose production mode when NODE_ENV="production" * Update cli.zig * [jsx] Handle defaultProps when inlining * Update transpiler.test.js * uncomment some tests Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/javascript/jsc/bindings/URLDecomposition.cpp')
-rw-r--r--src/javascript/jsc/bindings/URLDecomposition.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/javascript/jsc/bindings/URLDecomposition.cpp b/src/javascript/jsc/bindings/URLDecomposition.cpp
index eb21e36c8..84e734528 100644
--- a/src/javascript/jsc/bindings/URLDecomposition.cpp
+++ b/src/javascript/jsc/bindings/URLDecomposition.cpp
@@ -57,7 +57,7 @@ String URLDecomposition::username() const
void URLDecomposition::setUsername(StringView user)
{
auto fullURL = this->fullURL();
- if (fullURL.host().isEmpty() || fullURL.cannotBeABaseURL() || fullURL.protocolIs("file"))
+ if (fullURL.host().isEmpty() || fullURL.cannotBeABaseURL() || fullURL.protocolIs("file"_s))
return;
fullURL.setUser(user);
setFullURL(fullURL);
@@ -71,7 +71,7 @@ String URLDecomposition::password() const
void URLDecomposition::setPassword(StringView password)
{
auto fullURL = this->fullURL();
- if (fullURL.host().isEmpty() || fullURL.cannotBeABaseURL() || fullURL.protocolIs("file"))
+ if (fullURL.host().isEmpty() || fullURL.cannotBeABaseURL() || fullURL.protocolIs("file"_s))
return;
fullURL.setPassword(password);
setFullURL(fullURL);
@@ -95,7 +95,7 @@ static unsigned countASCIIDigits(StringView string)
void URLDecomposition::setHost(StringView value)
{
auto fullURL = this->fullURL();
- if (value.isEmpty() && !fullURL.protocolIs("file") && fullURL.hasSpecialScheme())
+ if (value.isEmpty() && !fullURL.protocolIs("file"_s) && fullURL.hasSpecialScheme())
return;
size_t separator = value.reverseFind(':');
@@ -148,7 +148,7 @@ void URLDecomposition::setHostname(StringView value)
{
auto fullURL = this->fullURL();
auto host = removeAllLeadingSolidusCharacters(value);
- if (host.isEmpty() && !fullURL.protocolIs("file") && fullURL.hasSpecialScheme())
+ if (host.isEmpty() && !fullURL.protocolIs("file"_s) && fullURL.hasSpecialScheme())
return;
if (fullURL.cannotBeABaseURL() || !fullURL.canSetHostOrPort())
return;
@@ -195,7 +195,7 @@ static std::optional<std::optional<uint16_t>> parsePort(StringView string, Strin
void URLDecomposition::setPort(StringView value)
{
auto fullURL = this->fullURL();
- if (fullURL.host().isEmpty() || fullURL.cannotBeABaseURL() || fullURL.protocolIs("file") || !fullURL.canSetHostOrPort())
+ if (fullURL.host().isEmpty() || fullURL.cannotBeABaseURL() || fullURL.protocolIs("file"_s) || !fullURL.canSetHostOrPort())
return;
auto port = parsePort(value, fullURL.protocol());
if (!port)