aboutsummaryrefslogtreecommitdiff
path: root/updater/sql/mac/lib/trace.js
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2024-06-16 12:02:05 +0200
committerRaindropsSys <raindrops@equestria.dev>2024-06-16 12:02:05 +0200
commit55c7ee618e5d59ac5eb691febb6dd911f3f75d2a (patch)
tree310ff9cc2178a5f3a35aaa5ea8f1352114018f53 /updater/sql/mac/lib/trace.js
parente44e2fe070484e06d384a31ef2699c3a2d5d474e (diff)
downloadfaunerie-55c7ee618e5d59ac5eb691febb6dd911f3f75d2a.tar.gz
faunerie-55c7ee618e5d59ac5eb691febb6dd911f3f75d2a.tar.bz2
faunerie-55c7ee618e5d59ac5eb691febb6dd911f3f75d2a.zip
Fix SQL stuff + remove C++ code
Diffstat (limited to 'updater/sql/mac/lib/trace.js')
-rwxr-xr-xupdater/sql/mac/lib/trace.js38
1 files changed, 0 insertions, 38 deletions
diff --git a/updater/sql/mac/lib/trace.js b/updater/sql/mac/lib/trace.js
deleted file mode 100755
index 1d84cb0..0000000
--- a/updater/sql/mac/lib/trace.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Inspired by https://github.com/tlrobinson/long-stack-traces
-const util = require('util');
-
-function extendTrace(object, property, pos) {
- const old = object[property];
- object[property] = function() {
- const error = new Error();
- const name = object.constructor.name + '#' + property + '(' +
- Array.prototype.slice.call(arguments).map(function(el) {
- return util.inspect(el, false, 0);
- }).join(', ') + ')';
-
- if (typeof pos === 'undefined') pos = -1;
- if (pos < 0) pos += arguments.length;
- const cb = arguments[pos];
- if (typeof arguments[pos] === 'function') {
- arguments[pos] = function replacement() {
- const err = arguments[0];
- if (err && err.stack && !err.__augmented) {
- err.stack = filter(err).join('\n');
- err.stack += '\n--> in ' + name;
- err.stack += '\n' + filter(error).slice(1).join('\n');
- err.__augmented = true;
- }
- return cb.apply(this, arguments);
- };
- }
- return old.apply(this, arguments);
- };
-}
-exports.extendTrace = extendTrace;
-
-
-function filter(error) {
- return error.stack.split('\n').filter(function(line) {
- return line.indexOf(__filename) < 0;
- });
-}