aboutsummaryrefslogtreecommitdiff
path: root/integration/snapshots
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-12-30 21:12:32 -0800
committerGravatar GitHub <noreply@github.com> 2021-12-30 21:12:32 -0800
commite75c711c68896f5952793601f156c921c814caab (patch)
treef3b30e2281c7231d480bb84503d17b2370866ff9 /integration/snapshots
parent8d031f13c0e04629d431176e211a31224b7618c0 (diff)
downloadbun-e75c711c68896f5952793601f156c921c814caab.tar.gz
bun-e75c711c68896f5952793601f156c921c814caab.tar.zst
bun-e75c711c68896f5952793601f156c921c814caab.zip
Upgrade to latest Zig, remove dependency on patched version of Zig (#96)
* Prepare to upgrade zig * zig fmt * AllocGate * Update data_url.zig * wip * few files * just headers now? * I think everything works? * Update mimalloc * Update hash_map.zig * Perf improvements to compensate for Allocgate * Bump * :camera: * Update bun.lockb * Less branching * [js parser] Slightly reduce memory usage * Update js_parser.zig * WIP remove unused * [JS parser] WIP support for `with` keyword * Remove more dead code * Fix all the build errors! * cleanup * Move `network_thread` up * Bump peechy * Update README.md
Diffstat (limited to 'integration/snapshots')
-rw-r--r--integration/snapshots/caught-require.debug.js30
-rw-r--r--integration/snapshots/caught-require.hmr.debug.js50
-rw-r--r--integration/snapshots/jsx-entities.debug.jsx2
-rw-r--r--integration/snapshots/number-literal-bug.debug.js9
-rw-r--r--integration/snapshots/optional-chain-with-function.debug.js6
-rw-r--r--integration/snapshots/template-literal.debug.js37
-rw-r--r--integration/snapshots/unicode-identifiers.debug.js4
-rw-r--r--integration/snapshots/unicode-identifiers.hmr.debug.js4
8 files changed, 134 insertions, 8 deletions
diff --git a/integration/snapshots/caught-require.debug.js b/integration/snapshots/caught-require.debug.js
new file mode 100644
index 000000000..690ec4db5
--- /dev/null
+++ b/integration/snapshots/caught-require.debug.js
@@ -0,0 +1,30 @@
+import {
+__require as require
+} from "http://localhost:8080/__runtime.js";
+try {
+ require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
+
+} catch (exception) {
+}
+
+try {
+ await import("this-package-should-not-exist");
+} catch (exception) {
+}
+import("this-package-should-not-exist").then(() => {
+}, () => {
+});
+export async function test() {
+ try {
+ require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
+ } catch (exception) {
+ }
+ try {
+ await import("this-package-should-not-exist");
+ } catch (exception) {
+ }
+ import("this-package-should-not-exist").then(() => {
+ }, () => {
+ });
+ return testDone(import.meta.url);
+}
diff --git a/integration/snapshots/caught-require.hmr.debug.js b/integration/snapshots/caught-require.hmr.debug.js
new file mode 100644
index 000000000..25883fac7
--- /dev/null
+++ b/integration/snapshots/caught-require.hmr.debug.js
@@ -0,0 +1,50 @@
+import {
+__require as require
+} from "http://localhost:8080/__runtime.js";
+import {
+__HMRModule as HMR
+} from "http://localhost:8080/__runtime.js";
+import {
+__HMRClient as Bun
+} from "http://localhost:8080/__runtime.js";
+Bun.activate(true);
+
+var hmr = new HMR(2398506918, "caught-require.js"), exports = hmr.exports;
+await (hmr._load = async function() {
+ try {
+ require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
+ } catch (exception) {
+ }
+ try {
+ await import("this-package-should-not-exist");
+ } catch (exception) {
+ }
+ import("this-package-should-not-exist").then(() => {
+ }, () => {
+ });
+ async function test() {
+ try {
+ require((() => { throw (new Error(`Cannot require module '"this-package-should-not-exist"'`)); } )());
+ } catch (exception) {
+ }
+ try {
+ await import("this-package-should-not-exist");
+ } catch (exception) {
+ }
+ import("this-package-should-not-exist").then(() => {
+ }, () => {
+ });
+ return testDone(import.meta.url);
+ }
+ hmr.exportAll({
+ test: () => test
+ });
+})();
+var $$hmr_test = hmr.exports.test;
+hmr._update = function(exports) {
+ $$hmr_test = exports.test;
+};
+
+export {
+ $$hmr_test as test
+};
diff --git a/integration/snapshots/jsx-entities.debug.jsx b/integration/snapshots/jsx-entities.debug.jsx
index 5d289b3d0..cfaf14c10 100644
--- a/integration/snapshots/jsx-entities.debug.jsx
+++ b/integration/snapshots/jsx-entities.debug.jsx
@@ -908,7 +908,7 @@ const elements = {
children: "."
}, undefined, false, undefined, this))]: 46,
[ReactDOM.renderToString(jsx(JSXFrag, {
- children: "\x2F"
+ children: "/"
}, undefined, false, undefined, this))]: 47,
[ReactDOM.renderToString(jsx(JSXFrag, {
children: "0"
diff --git a/integration/snapshots/number-literal-bug.debug.js b/integration/snapshots/number-literal-bug.debug.js
new file mode 100644
index 000000000..c62e2d9ff
--- /dev/null
+++ b/integration/snapshots/number-literal-bug.debug.js
@@ -0,0 +1,9 @@
+export function test() {
+ const precision = 10;
+ try {
+ parseFloat(0 .toPrecision(precision) + "1");
+ } catch (exception) {
+ throw new Error("Test Failed", exception);
+ }
+ testDone(import.meta.url);
+}
diff --git a/integration/snapshots/optional-chain-with-function.debug.js b/integration/snapshots/optional-chain-with-function.debug.js
index bf007b0a8..6f963caa2 100644
--- a/integration/snapshots/optional-chain-with-function.debug.js
+++ b/integration/snapshots/optional-chain-with-function.debug.js
@@ -3,9 +3,9 @@ export function test() {
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);
+ 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/template-literal.debug.js b/integration/snapshots/template-literal.debug.js
new file mode 100644
index 000000000..e5c4c09a7
--- /dev/null
+++ b/integration/snapshots/template-literal.debug.js
@@ -0,0 +1,37 @@
+const css = (templ) => templ.toString();
+const fooNoBracesUTF8 = css`
+ before
+ /* */
+ after
+`;
+const fooNoBracesUT16 = css`
+ before
+ 🙃
+ after
+`;
+const fooUTF8 = css`
+ before
+ ${true}
+ after
+
+`;
+const fooUTF16 = css`
+ before
+ 🙃 ${true}
+ after
+
+`;
+const templateLiteralWhichDefinesAFunction = ((...args) => args[args.length - 1]().toString())`
+ before
+ 🙃 ${() => true}
+ after
+
+`;
+export function test() {
+ for (let foo of [fooNoBracesUT16, fooNoBracesUTF8, fooUTF16, fooUTF8]) {
+ console.assert(foo.includes("before"), `Expected ${foo} to include "before"`);
+ console.assert(foo.includes("after"), `Expected ${foo} to include "after"`);
+ }
+ console.assert(templateLiteralWhichDefinesAFunction.includes("true"), "Expected fooFunction to include 'true'");
+ return testDone(import.meta.url);
+}
diff --git a/integration/snapshots/unicode-identifiers.debug.js b/integration/snapshots/unicode-identifiers.debug.js
index c495d69f6..4a192c22a 100644
--- a/integration/snapshots/unicode-identifiers.debug.js
+++ b/integration/snapshots/unicode-identifiers.debug.js
@@ -1,7 +1,7 @@
-var ε = 1.0e-06, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;
+var ε = 0.000001, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;
export {d3_radians};
export function test() {
- console.assert(ε === 1.0e-06);
+ console.assert(ε === 0.000001);
return testDone(import.meta.url);
}
diff --git a/integration/snapshots/unicode-identifiers.hmr.debug.js b/integration/snapshots/unicode-identifiers.hmr.debug.js
index 729365d1d..894cd0fe5 100644
--- a/integration/snapshots/unicode-identifiers.hmr.debug.js
+++ b/integration/snapshots/unicode-identifiers.hmr.debug.js
@@ -8,9 +8,9 @@ Bun.activate(true);
var hmr = new HMR(1398361736, "unicode-identifiers.js"), exports = hmr.exports;
(hmr._load = function() {
- var ε = 1.0e-06, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;
+ var ε = 0.000001, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;
function test() {
- console.assert(ε === 1.0e-06);
+ console.assert(ε === 0.000001);
return testDone(import.meta.url);
}
hmr.exportAll({