aboutsummaryrefslogtreecommitdiff
path: root/src/js_parser.zig (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-07-20resolve rope in `string()`dylan/resolve-rope-in-stringGravatar Dylan Conway 1-2/+1
2023-07-20`resolveRopeIfNeeded` (#3708)Gravatar Dylan Conway 1-0/+1
2023-07-19set `did_panic` flag (#3687)Gravatar Dylan Conway 1-1/+5
2023-07-18zig upgrade (#3667)Gravatar Dylan Conway 1-34/+34
* upgrade * more fixes * Bump Zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-08Handle case with TS decorators and export default anonymous class (#3578)Gravatar Jarred Sumner 1-1/+11
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-08Fix bug with decorators not being generated in `export default class` (#3577)Gravatar Jarred Sumner 1-1/+12
* Fix bug with decorators not being generated in `export default class` * Update decorator-export-default-class-fixture.ts --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-06Fixes #3537 (#3539)Gravatar Jarred Sumner 1-10/+41
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-05don't unwrap react below version `18.0.0` (#3538)Gravatar Dylan Conway 1-5/+20
* don't unwrap react below version 18 * empty string * also `react-dom`
2023-06-29Fixes #3462 (#3465)Gravatar Jarred Sumner 1-0/+24
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-29[bundler] avoid printing unnecessary declarations (#3456)Gravatar Dylan Conway 1-58/+16
* skip declarations without values * tests * deoptimize cjs when decls are needed
2023-06-24Rewrite Bun's runtime CommonJS loader (#3379)Gravatar Jarred Sumner 1-26/+63
* wip changes for CommonJS * this rewrite is almost complete * even more code * wip * Remove usages of `import.meta.require` from builtins * Remove usages of require * Regenerate * :scissors: builtin rewrite commonjs in printer * Use lazy custom getters for import.meta * fixups * Remove depd * ugh * still crashing * fixup undici * comment out import.meta.require.resolve temporarily not a real solution but it stops the crashes * Redo import.meta.primordials * Builtins now have a `builtin://` protocol in source origin * Seems to work? * Finsih getting rid of primordials * switcharoo * No more function * just one more bug * Update launch.json * Implement `require.main` * :scissors: * Bump WebKit * Fixup import cycles * Fixup improt cycles * export more things * Implement `createCommonJSModule` builtin * More exports * regenerate * i broke some stuff * some of these tests work now * We lost the encoding * Sort of fix zlib * Sort of fix util * Update events.js * bump * bump * bump * Fix missing export in fs * fix some bugs with builtin esm modules (stream, worker_threads, events). its not perfect yet. * fix some other internal module bugs * oops * fix some extra require default stuff * uncomment this file but it crsahes on my machine * tidy code here * fixup tls exports * make simdutf happier * Add hasPrefix binding * Add test for `require.main` * Fix CommonJS evaluation order race condition * Make node:http load faster * Add missing exports to tls.js * Use the getter * Regenerate builtins * Fix assertion failure in Bun.write() * revamp dotEnv parser (#3347) - fixes `strings.indexOfAny()` - fixes OOB array access fixes #411 fixes #2823 fixes #3042 * fix tests for `expect()` (#3384) - extend test job time-out for `darwin-aarch64` * `expect().resolves` and `expect().rejects` (#3318) * Move expect and snapshots to their own files * expect().resolves and expect().rejects * Fix promise being added to unhandled rejection list * Handle timeouts in expect(<promise>) * wip merge * Fix merge issue --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> * fixup min/memcopy (#3388) * Fix crash in builtins * Don't attempt to evaluate modules with no source code * Update WebCoreJSBuiltins.cpp * Update WebCoreJSBuiltins.cpp * Update WebCoreJSBuiltins.cpp * Fix crash * cleanup * Fix test cc @paperdave * Fixup Undici * Fix issue in node:http * Create util-deprecate.mjs * Fix several bugs * Use the identifier * Support error.code in `util.deprecate` * make the CJs loader slightly more resilient * Update WebCoreJSBuiltins.cpp * Fix macros --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: dave caruso <me@paperdave.net> Co-authored-by: Alex Lam S.L <alexlamsl@gmail.com> Co-authored-by: Ashcon Partovi <ashcon@partovi.net> Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2023-06-21upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)Gravatar Dylan Conway 1-55/+52
* progress * finish `@memset/@memcpy` update * Update build.zig * change `@enumToInt` to `@intFromEnum` and friends * update zig versions * it was 1 * add link to issue * add `compileError` reminder * fix merge * format * upgrade to llvm 16 * Revert "upgrade to llvm 16" This reverts commit cc930ceb1c5b4db9614a7638596948f704544ab8. --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-20record jsx factory symbols in classic mode (#3360)Gravatar Dylan Conway 1-1/+7
* record jsx factory symbols * merge factory/fragment when more than one part * update test * use existing functions, use, `memberListToComponentsIfDifferent` * missing file * fix defaults
2023-06-19Fix bug that breaks `bunx prisma init` when node is not installed (#3362)Gravatar Jarred Sumner 1-2/+35
* tweak cjs * Handle more cases, add a test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-16don't remove const if referenced before declaration (#3337)Gravatar Dylan Conway 1-3/+3
2023-06-15Tweak CommonJS output (#3320)Gravatar Jarred Sumner 1-6/+8
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-14Workaround issue with module.require =Gravatar Jarred Sumner 1-8/+64
2023-06-12handle unwrapping `require` in any expression (#3292)Gravatar Dylan Conway 1-5/+25
2023-06-09Fixes #3206 (#3262)Gravatar Jarred Sumner 1-47/+75
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-09Implement mocks in bun:test (#3252)Gravatar Jarred Sumner 1-0/+2
* wip * wip * most of the code for mocks in bun:test * finishing up * Implement `toHaveBeenCalled` and `toHaveBeenCalledTimes(1)` * Test * visit * results, not returnValues * exact * Update jest.zig * A couple more tests * Add jest.fn * support resetting mocks * Implement spyOn --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-01Implement `__dirname` and `__filename`, allow direct eval in CommonJS (#3164)Gravatar Jarred Sumner 1-19/+27
* Implement `__dirname` and `__filename`, allow direct eval in CommonJS * Fixup dirname and add test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-01only add cjs export name if it is assigned (#3159)Gravatar Dylan Conway 1-1/+1
2023-05-31don't rewrite `module.exports` if assign target is `update` or `replace` (#3147)bun-v0.6.6Gravatar Dylan Conway 1-9/+16
* don't rewrite `module.exports` if assign target is `update` or `replace` * missing `is_delete_target`, check de-opt before rewriting
2023-05-31set `optional_chain` instead of `optional_start` (#3142)Gravatar Dylan Conway 1-1/+1
2023-05-31`--no-macros` flag, disable macros in node_modulesGravatar Jarred Sumner 1-0/+23
2023-05-30[CommonJS] Handle `this` betterGravatar Jarred Sumner 1-5/+19
2023-05-29Natively support CommonJS at runtime (#3104)Gravatar Jarred Sumner 1-491/+570
* Natively support CommonJS at runtime * cleanup how getters are handled, add fast path * more consistent with node * use * As * Remove thrown modules on exception * Handle exception better --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-28Convert `module.exports = { foo: 'bar'}` to ESM in `bun build` (#3103)Gravatar Jarred Sumner 1-1/+164
* Convert `module.exports = { foo: 'bar'}` to ESM in `bun build` * De-opt for `module.exports = {}` --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-27Fixes #3091 (#3092)Gravatar Jarred Sumner 1-2/+0
* Fixes #3091 * Update build-id --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-25avoid using null valueGravatar Dylan Conway 1-2/+4
2023-05-24Support `with { type: "macro"}` in `bun build` (#3059)Gravatar Jarred Sumner 1-6/+32
* [bun macro] Support `assert { type: "macro" }` and `with {type: "macro"}` * [bun macro] Pass through input as arguments instead of a JSNode * Fix hang when loading many entry points simultaneously with macros * do not clone --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-24Load `.env.test`, set NODE_ENV=test in `bun test`, load ↵Gravatar Jarred Sumner 1-7/+3
`.env.{test,production,development}.local` (#3037) * Support `.env.test` & `.env.{test,production,development}.local` * Fix bug preventing inlining of process.env.NODE_ENV by default * Update env_loader.zig * add env tests --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: dave caruso <me@paperdave.net>
2023-05-24fix setting `jsxImportSource`, `jsxFactory`, and `jsxFragmentFactory` (#3057)Gravatar Dylan Conway 1-70/+24
* default automatic, merge jsx flags from multiple tsconfigs * use entire package name * some tests * more tests
2023-05-22only merge if kind is `var`Gravatar Dylan Conway 1-1/+4
2023-05-19make sure `key` is added to args (#2968)Gravatar Dylan Conway 1-9/+7
2023-05-18Fixes #2946 (#2949)Gravatar Jarred Sumner 1-1/+4
* Fixes #2946 * Update string_mutable.zig * Fixes #2948 --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-18use raw template contents for tagged templates (#2937)Gravatar Dylan Conway 1-8/+15
* use raw template contents when tagged * use union for template contents * pointer to cooked contents * raw if suffix * fix and don't skip test
2023-05-15handle printing missing expressions and add tests (#2872)Gravatar Dylan Conway 1-35/+87
* handle missing expressions and add tests * minify missing expression blocks in parser
2023-05-15More DCEGravatar Jarred Sumner 1-27/+34
2023-05-15Set more things to `const`Gravatar Jarred Sumner 1-13/+12
2023-05-14wipGravatar Jarred Sumner 1-3/+3
2023-05-14Fix scope chain bugGravatar Jarred Sumner 1-6/+5
2023-05-12finish #2864Gravatar Jarred Sumner 1-4/+3
2023-05-12disable sloppy mode block level functions when not bundling (#2864)Gravatar Dylan Conway 1-1/+6
* enable only during bundling * add `willUseNumberRenamer()`
2023-05-12[bundler] Disable export star redirect code size optimizationGravatar Jarred Sumner 1-30/+52
2023-05-12[bundler] Implement `export * from` code size optimizationGravatar Jarred Sumner 1-21/+36
2023-05-12[bundler] Fix bug with `export default TypeScriptType`Gravatar Jarred Sumner 1-0/+3
2023-05-12Fix regressionGravatar Jarred Sumner 1-5/+3
2023-05-11Fix our tree shaking optimizationGravatar Jarred Sumner 1-48/+90
2023-05-10make sure vars can be hoisted in catch scope (#2847)Gravatar Dylan Conway 1-23/+34