From c2a77cf7ec9de9eadf938046bdf78e58561c8a6d Mon Sep 17 00:00:00 2001 From: dave caruso Date: Wed, 2 Aug 2023 16:27:36 -0700 Subject: Rewrite built-in modules to use CommonJS over ESM (#3814) * stfdsafsd sadffdsa stuff finish commonjs stuff asdf not done but work not done but work not done yet but this is how far i am remove files lol update built files uncomment everything in events lol export default stuff * afdsafsd * its not perfect but almost done * okay * cool * remove temp file * finish rebase * revert settings.json * a * ch-ch-ch-ch-changes * okay * remove this check in release for now * sxdcfghnjm, * lkjhgf * fmt * filename can be null * Update NodeModuleModule.h * weee * fmt --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- src/js/node/assert.js | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'src/js/node/assert.js') diff --git a/src/js/node/assert.js b/src/js/node/assert.js index a00a84509..475f72006 100644 --- a/src/js/node/assert.js +++ b/src/js/node/assert.js @@ -1,6 +1,5 @@ // Hardcoded module "node:assert" -var { Bun } = $lazy("primordials"); -import util from "node:util"; +const util = require("node:util"); var isDeepEqual = Bun.deepEquals; var __commonJS = (cb, mod) => @@ -653,7 +652,6 @@ var require_assertion_error = __commonJS({ .concat(indicator); } var AssertionError = /* @__PURE__ */ (function (_Error) { - _inherits(AssertionError2, _Error); function AssertionError2(options) { var _this; if ((_classCallCheck(this, AssertionError2), _typeof(options) !== "object" || options === null)) @@ -781,6 +779,8 @@ should equal _possibleConstructorReturn(_this) ); } + AssertionError2.prototype = {}; + _inherits(AssertionError2, _Error); return ( _createClass(AssertionError2, [ { @@ -830,6 +830,7 @@ var require_assert = __commonJS({ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } + var _require = require_errors(), _require$codes = _require.codes, ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT, @@ -1256,26 +1257,6 @@ function CallTracker() { throw new Error("CallTracker is not supported yet"); } -assert_module[Symbol.for("CommonJS")] = 0; assert_module["CallTracker"] = CallTracker; -export var { - AssertionError, - assert, - deepEqual, - deepStrictEqual, - doesNotReject, - doesNotThrow, - equal, - fail, - ifError, - notDeepEqual, - notDeepStrictEqual, - notEqual, - notStrictEqual, - ok, - rejects, - strict, - strictEqual, - throws, -} = assert_module; + export default assert_module; -- cgit v1.2.3