From aa39b2e2c9bc7612dcd60b93f2f6f1202a484abc Mon Sep 17 00:00:00 2001 From: Jelle De Loecker Date: Sat, 10 Feb 2024 16:56:44 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20custom=20janeway=20representa?= =?UTF-8?q?tion=20to=20Trail=20class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/trail.js | 30 ++++++++++++++++++++++++++++++ test/string.js | 1 - 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lib/trail.js b/lib/trail.js index bad1c28..2e0f832 100644 --- a/lib/trail.js +++ b/lib/trail.js @@ -254,4 +254,34 @@ Trail.setMethod(function extractOrEvaluate(context) { } return this[GET_OR_EVALUATE](context, true); +}); + +if (!Blast.isServer) { + return; +} + +/** + * Custom Janeway representation (left side) + * + * @author Jelle De Loecker + * @since 0.9.0 + * @version 0.9.0 + * + * @return {string} + */ +Trail.setMethod(Symbol.for('janeway_arg_left'), function janewayClassIdentifier() { + return this.constructor.name; +}); + +/** + * Custom Janeway representation (right side) + * + * @author Jelle De Loecker + * @since 0.9.0 + * @version 0.9.0 + * + * @return {string} + */ +Trail.setMethod(Symbol.for('janeway_arg_right'), function janewayInstanceInfo() { + return this[CHAIN].join(' ยป '); }); \ No newline at end of file diff --git a/test/string.js b/test/string.js index 0530d57..492d414 100644 --- a/test/string.js +++ b/test/string.js @@ -163,7 +163,6 @@ describe('String', function() { source = source.trim(); let tokens = Function.tokenize(source); - console.log('Tokens:', tokens); return tokens[0]; };