1

Topic: [typescript] how to receive a class/method name/type?

Prompt how to make the following: - to receive in a method of a class class name? - To receive in a method of a class method name which we now we are? - To receive object type (i.e. if it is a copy of any class to receive a name of this class, tried typeof is returned object)? - Being in a method to receive method name and a class (if it is a class method) which your method caused? Well or advise  in which it would be possible simply caused static method Logger.w (' bla ') and in  on by ' bla '  class name and a method from  we caused this broad gull. Though as  above  all  is interesting.

2

Re: [typescript] how to receive a class/method name/type?

Hello, Young, you wrote: Y> Prompt how to make the following: Y> - to receive in a method of a class class name? Look Proxy Y> - to receive in a method of a class method name which we now we are? Proxy Y> - to receive object type (i.e. if it is a copy of any class to receive a name of this class, tried typeof is returned object)? instanceOf Y> - being in a method to receive method name and a class (if it is a class method) which your method caused? Proxy Y> well or advise  in which it would be possible simply caused static method Logger.w (' bla ') and in  on by ' bla '  class name and a method from  we caused this broad gull. Though as  above  all  is interesting. Look CEF, ES6, Angular 2, TypeScript at usage of classes.Net Core. Creation  GUI for.Net by means of CEF

3

Re: [typescript] how to receive a class/method name/type?

Hello, Serginio1, you wrote: S> Proxy It is meant Proxy as a designing template? Well I cannot turn all objects. Or I not so understood something. Whether S> instanceOf how much I see it allows to check is the object certain type or not. I need to receive in advance not a known name of type in the form of a line. S> look S> CEF, ES6, Angular 2, TypeScript at usage of classes.Net Core. At creation  GUI for.Net by means of CEF Looked. Fairly did not see anything about . Here I want to implement static function Logger.debug (str: string) which would deduce in the console class name and method name in which it has been caused. How to it to be risen? In what classes it will be used in advance it is not known.

4

Re: [typescript] how to receive a class/method name/type?

Hello, Young, you wrote: Y> Hello, Serginio1, you wrote: S>> Proxy Y> It is meant Proxy as a designing template? https://developer.mozilla.org/ru/docs/W … ects/Proxy Y> well I cannot turn all objects. Or I not so understood something. And how you want  to implement the? Whether S>> instanceOf Y> how much I see it allows to check is the object certain type or not. I need to receive in advance not a known name of type in the form of a line. Write for each class method GetTypeInfo S>> Look S>> CEF, ES6, Angular 2, TypeScript at usage of classes.Net Core. At creation  GUI for.Net by means of CEF Y> Looked. Fairly did not see anything about . About  there anything is not present. Is about Proxy. Y> Here I want to implement static function Logger.debug (str: string) which would deduce in the console class name and method name in which it has been caused. How to it to be risen? In what classes it will be used in advance it is not known. Except Proxy it is possible to look aside  https://learn.javascript.ru/prototype

5

Re: [typescript] how to receive a class/method name/type?

Hello, Serginio1, you wrote: S> Hello, Young, you wrote: Y>> Hello, Serginio1, you wrote: S>>> Proxy Y>> It is meant Proxy as a designing template? S> https://developer.mozilla.org/ru/docs/W … ects/Proxy Y>> well I cannot turn all objects. Or I not so understood something. S> and how you want  to implement the? In any way. I want that  gave a row of static functions and all. I.e. I write Logger.log (and all I.e. in object class  will not be. Whether S>>> instanceOf Y>> how much I see it allows to check is the object certain type or not. I need to receive in advance not a known name of type in the form of a line. S> write for each class method GetTypeInfo the Question as it to implement. Well not  a line inside. For then at  a class still to remember that it is necessary to change a constant also.

6

Re: [typescript] how to receive a class/method name/type?

Hello, Young, you wrote: Y> the Question as it to implement. Well not  a line inside. For then at  a class still to remember that it is necessary to change a constant also. Write a proxy and turn the class necessary to you

7

Re: [typescript] how to receive a class/method name/type?

Hello, Young, you wrote: Y> Prompt how to make the following: Y> - to receive in a method of a class class name? TS it is broadcast in JS, and there classes can and not to be. What for you means class name in ES5? Y> - to receive in a method of a class method name which we now we are? arguments.callee. Y> - to receive object type (i.e. if it is a copy of any class to receive a name of this class, tried typeof is returned object)? Here some variants. For example Object.prototype.toString.call (abc) If it is function, i.e. [object Function] that the simple call.toString gives function name (together with the code). Y> - being in a method to receive method name and a class (if it is a class method) which your method caused? arguments.caller / Fuction.caller Y> Well or advise  in which it would be possible simply caused static method Logger.w (' bla ') and in  on by ' bla '  class name and a method from  we caused this broad gull. Though as  above  all  is interesting.

8

Re: [typescript] how to receive a class/method name/type?

Hello, _NN _, you wrote: _NN> Hello, Young, you wrote: Y>> Prompt how to make the following: Y>> - to receive in a method of a class class name? _NN> TS it is broadcast in JS, and there classes can and not to be. _NN> that for you means class name in ES5?  Well i.e.  - but me syntactic sugar is necessary to me, I do not want in each place where I plan to write this.log.debug still to write in the text "ClassName:: MethodName bla" To me it is necessary to write some thousand lines with comfort and as a whole to hammer. Plus I  can  and under ES6 - so classes as though are. But I am is specific about this point the decision found - class SomeClass {log = Log.create (this.constructor.name); constructor () {this.log.d (' Test ');} } Gives me that that is necessary. It is necessary to understand in two things - method name obtaining - that each time when I  and I rename a method, well it would be necessary to change broad gulls, and the second part to hide these things  most  - i.e.  it was not necessary to transfer evidently in the designer class name and in a method  method name - and he defined. Y>> - being in a method to receive method name and a class (if it is a class method) which your method caused? _NN> arguments.caller / Fuction.caller ' caller ' and ' arguments ' are restricted function properties and cannot be accessed in this context.

9

Re: [typescript] how to receive a class/method name/type?

Hello, Young, you wrote: Y>>> Prompt how to make the following: Y>>> - to receive in a method of a class class name? _NN>> TS it is broadcast in JS, and there classes can and not to be. _NN>> that for you means class name in ES5? Y>  Well i.e.  - but me syntactic sugar is necessary To me, I do not want in each place where I plan to write Y> this.log.debug still write in the text "ClassName:: MethodName bla" Can set dressers help? https://www.typescriptlang.org/docs/han … ators.html examples: https://gist.github.com/remojansen/16c661a7afd68e22ac6e