-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wasm * WASM test scanner * Update Makefile * Update Makefile * Configurable heap limit * slightly better error * Update js_parser.zig * Update path.test.js * Update node.mjs --------- Co-authored-by: Jarred Sumner <[email protected]>
- Loading branch information
1 parent
0b183be
commit f2f2277
Showing
25 changed files
with
966 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,7 @@ | ||
// This is not released yet because there are some memory bugs with the WASM build | ||
// It causes syntax errors which don't make any sense | ||
// Most likely, this is an issue with some code expecting 64 bit pointers | ||
// That's also why this test just prints instead of using a test runner | ||
import * as Bun from "../index.mjs"; | ||
import { readFileSync } from "fs"; | ||
import { init, getTests } from "../index.mjs"; | ||
|
||
await Bun.init(new URL("../bun.wasm", import.meta.url)); | ||
const buf = (process.argv.length > 2 ? readFileSync(process.argv.at(-1)) : "") || readFileSync(import.meta.url); | ||
await init(new URL("../bun.wasm", import.meta.url)); | ||
|
||
const buf = | ||
(process.argv.length > 2 ? process.argv.at(-1) : "") || | ||
new TextEncoder().encode(` | ||
export function hi() { | ||
return <div>Hey</div>; | ||
} | ||
`); | ||
const result = Bun.transformSync(buf, "hi.jsx", "jsx"); | ||
if (result.errors?.length) { | ||
console.log(JSON.stringify(result.errors, null, 2)); | ||
throw new Error("Failed"); | ||
} | ||
|
||
if (!result.files.length) { | ||
throw new Error("unexpectedly empty"); | ||
} | ||
|
||
process.stdout.write(result.files[0].data); | ||
console.log(getTests(buf)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.