From d212a8df81a8fc984b5fcbd42af98b8df5ecdf74 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 7 Jun 2019 08:24:16 +0200 Subject: [PATCH] Expose {method,section}Name on Method class (#975) * Expose {method,module}Name on Method class * moduleName -> sectionName to align --- 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 82c73ce0944a..0aa5805c625d 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 sectionName (): string { + return Method.findFunction(this.callIndex).section; + } + /** * @description Returns the base runtime type name for this instance */