aboutsummaryrefslogtreecommitdiff
path: root/src/js/node/assert.js
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-08-02 16:27:36 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-02 16:27:36 -0700
commitc2a77cf7ec9de9eadf938046bdf78e58561c8a6d (patch)
tree0f90f1b323061455875333c9f40592b303585973 /src/js/node/assert.js
parent7656b4b17e91f15b58eeab8f45b78c416ec6a045 (diff)
downloadbun-c2a77cf7ec9de9eadf938046bdf78e58561c8a6d.tar.gz
bun-c2a77cf7ec9de9eadf938046bdf78e58561c8a6d.tar.zst
bun-c2a77cf7ec9de9eadf938046bdf78e58561c8a6d.zip
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>
Diffstat (limited to 'src/js/node/assert.js')
-rw-r--r--src/js/node/assert.js29
1 files changed, 5 insertions, 24 deletions
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;