From 4c1dc63c3e314055c08a5d463adbaaae1ba0ccc0 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 6 Jun 2019 16:22:10 +0200 Subject: [PATCH 1/2] Expose {method,module}Name on Method class --- packages/types/src/primitive/Method.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/types/src/primitive/Method.ts b/packages/types/src/primitive/Method.ts index 113587e6f23c..63f54ca69f67 100644 --- a/packages/types/src/primitive/Method.ts +++ b/packages/types/src/primitive/Method.ts @@ -220,6 +220,20 @@ export default class Method extends Struct implements IMethod { return this._meta; } + /** + * @description Returns the name of the method + */ + get methodName (): string { + return Method.findFunction(this.callIndex).method; + } + + /** + * @description Returns the module containing the method + */ + get moduleName (): string { + return Method.findFunction(this.callIndex).section; + } + /** * @description Returns the base runtime type name for this instance */ From 28ab4ec11a9de5e71ff01151e1530366f2954fd4 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 7 Jun 2019 08:13:32 +0200 Subject: [PATCH 2/2] moduleName -> sectionName to align --- packages/types/src/primitive/Method.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/primitive/Method.ts b/packages/types/src/primitive/Method.ts index 63f54ca69f67..c0e48b27bb6b 100644 --- a/packages/types/src/primitive/Method.ts +++ b/packages/types/src/primitive/Method.ts @@ -230,7 +230,7 @@ export default class Method extends Struct implements IMethod { /** * @description Returns the module containing the method */ - get moduleName (): string { + get sectionName (): string { return Method.findFunction(this.callIndex).section; }