aboutsummaryrefslogtreecommitdiff
path: root/integration
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-11-08 17:42:18 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-11-08 17:42:18 -0800
commit351184991abf926ec52d798a29afafd02486859a (patch)
tree002d1b2a6ada1ce7a991826422ae0f92f5d0c7e9 /integration
parent14b51ef57c289f6a2622e0848b11d757183cd24d (diff)
downloadbun-351184991abf926ec52d798a29afafd02486859a.tar.gz
bun-351184991abf926ec52d798a29afafd02486859a.tar.zst
bun-351184991abf926ec52d798a29afafd02486859a.zip
:camera:
Diffstat (limited to 'integration')
-rw-r--r--integration/snapshots/optional-chain-with-function.hmr.js5
-rw-r--r--integration/snapshots/optional-chain-with-function.js13
-rw-r--r--integration/snapshots/package-json-exports/index.hmr.js3
-rw-r--r--integration/snapshots/package-json-exports/index.js3
4 files changed, 23 insertions, 1 deletions
diff --git a/integration/snapshots/optional-chain-with-function.hmr.js b/integration/snapshots/optional-chain-with-function.hmr.js
index 77ea50dd0..91666bf96 100644
--- a/integration/snapshots/optional-chain-with-function.hmr.js
+++ b/integration/snapshots/optional-chain-with-function.hmr.js
@@ -12,7 +12,10 @@ var hmr = new HMR(3608848620, "optional-chain-with-function.js"), exports = hmr.
try {
const multipleSecondaryValues = undefined;
const ratings = ["123"];
- const multipleSecondaryIds = ratings && (multipleSecondaryValues?.map)((value) => false);
+ var bar = multipleSecondaryValues?.map((value) => false);
+ bar = bar?.multipleSecondaryValues?.map((value) => false);
+ bar = bar?.bar?.multipleSecondaryValues?.map((value) => false);
+ bar = {}?.bar?.multipleSecondaryValues?.map((value) => false);
} catch (e) {
throw e;
}
diff --git a/integration/snapshots/optional-chain-with-function.js b/integration/snapshots/optional-chain-with-function.js
new file mode 100644
index 000000000..6f963caa2
--- /dev/null
+++ b/integration/snapshots/optional-chain-with-function.js
@@ -0,0 +1,13 @@
+export function test() {
+ try {
+ const multipleSecondaryValues = undefined;
+ const ratings = ["123"];
+ var bar = multipleSecondaryValues?.map((value) => false);
+ bar = bar?.multipleSecondaryValues?.map((value) => false);
+ bar = bar?.bar?.multipleSecondaryValues?.map((value) => false);
+ bar = {}?.bar?.multipleSecondaryValues?.map((value) => false);
+ } catch (e) {
+ throw e;
+ }
+ return testDone(import.meta.url);
+}
diff --git a/integration/snapshots/package-json-exports/index.hmr.js b/integration/snapshots/package-json-exports/index.hmr.js
index 508dd63ee..d4e1aff18 100644
--- a/integration/snapshots/package-json-exports/index.hmr.js
+++ b/integration/snapshots/package-json-exports/index.hmr.js
@@ -13,6 +13,8 @@ import * as $d2a171d2 from "http://localhost:8080/package-json-exports/node_modu
var InexactFile = require($d2a171d2);
import * as $522c6d1f from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/foo.js";
var ExactFile = require($522c6d1f);
+import * as $fce83cd7 from "http://localhost:8080/package-json-exports/node_modules/js-only-exports/browser/js-file.js";
+var JSFileExtensionOnly = require($fce83cd7);
Bun.activate(false);
var hmr = new HMR(1953708113, "package-json-exports/index.js"), exports = hmr.exports;
@@ -21,6 +23,7 @@ var hmr = new HMR(1953708113, "package-json-exports/index.js"), exports = hmr.ex
console.assert(InexactRoot.target === "browser");
console.assert(InexactFile.target === "browser");
console.assert(ExactFile.target === "browser");
+ console.assert(JSFileExtensionOnly.isJS === true);
return testDone(import.meta.url);
}
hmr.exportAll({
diff --git a/integration/snapshots/package-json-exports/index.js b/integration/snapshots/package-json-exports/index.js
index 1b260c7ea..882f9d489 100644
--- a/integration/snapshots/package-json-exports/index.js
+++ b/integration/snapshots/package-json-exports/index.js
@@ -7,11 +7,14 @@ import * as $d2a171d2 from "http://localhost:8080/package-json-exports/node_modu
var InexactFile = require($d2a171d2);
import * as $522c6d1f from "http://localhost:8080/package-json-exports/node_modules/inexact/browser/foo.js";
var ExactFile = require($522c6d1f);
+import * as $fce83cd7 from "http://localhost:8080/package-json-exports/node_modules/js-only-exports/browser/js-file.js";
+var JSFileExtensionOnly = require($fce83cd7);
export async function test() {
console.assert(InexactRoot.target === "browser");
console.assert(InexactFile.target === "browser");
console.assert(ExactFile.target === "browser");
+ console.assert(JSFileExtensionOnly.isJS === true);
return testDone(import.meta.url);
}