Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: enable logical assignment babel plugin (#8416)

Yury Semikhatsky7f02e9ebb1f8
diff --git a/.babelrc b/.babelrc
index fe20eab743..9050db519c 100644
--- a/.babelrc
+++ b/.babelrc
@@ -6,6 +6,7 @@
["@babel/plugin-transform-typescript", { "allowDeclareFields": true } ],
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-class-properties",
+ "@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-modules-commonjs"
],
diff --git a/src/client/network.ts b/src/client/network.ts
index 8e3c319f4f..e5f4dc4509 100644
--- a/src/client/network.ts
+++ b/src/client/network.ts
@@ -272,8 +272,8 @@ export class Route extends ChannelOwner<channels.RouteChannel, channels.RouteIni
let useInterceptedResponseBody;
let { status: statusOption, headers: headersOption, body: bodyOption } = options;
if (options._response) {
- statusOption = statusOption || options._response.status();
- headersOption = headersOption || options._response.headers();
+ statusOption ||= options._response.status();
+ headersOption ||= options._response.headers();
if (options.body === undefined && options.path === undefined) {
if (options._response === this._interceptedResponse)
useInterceptedResponseBody = true;