Initial commit

This commit is contained in:
2025-03-07 19:22:02 +01:00
commit 4a98255d83
55743 changed files with 5280367 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
var test = require("tap").test;
var chain = require('../../');
test("non extensible Error objects don't throw", function(t) {
var error = new Error("don't extend me");
Object.preventExtensions(error)
t.doesNotThrow(function() {
error.stack;
});
t.end();
});
test('stack is correct on non extensible error object', function (t) {
var error = new Error("don't extend me");
Object.preventExtensions(error);
chain.format.replace(function () {
return 'good';
});
try {
t.equal(error.stack, 'good');
} catch (e) { t.ifError(e); }
chain.format.restore();
t.end();
});