{"id":178367,"date":"2013-04-29T19:02:04","date_gmt":"2013-04-29T15:02:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=178367"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=178367","title":{"rendered":"<span class=\"post_title\">\u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f 2 \u0440\u0430\u0437\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0418\u0433\u0440\u0430\u044f\u0441\u044c \u0441 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u0430\u043c\u0438-\u0441\u0442\u0430\u0442\u0438\u043a\u043e\u0439-\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438 \u0432\u043e \u0444\u043b\u0435\u043a\u0441\u0435, \u0432\u043e\u0442 \u043d\u0430 \u0447\u0442\u043e \u043d\u0430\u043f\u043e\u0440\u043e\u043b\u0441\u044f:<\/p>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0415\u0441\u0442\u044c \u0444\u0430\u0439\u043b\u044b (https:\/\/github.com\/radistao\/test-super-and-static\/commit\/1f0a6):<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ChatModel.as<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"actionscript\">package { \tpublic class ChatModel \t{ \t\t \t\tpublic var someConst : String = getTrace(&quot;someConst&quot;); \t\tpublic var someVar : String = getTrace(&quot;someVar&quot;); \t\t \t\tpublic static const someStaticConst : String = getTrace(&quot;someStaticConst&quot;); \t\tpublic static var someStaticVar : String = getTrace(&quot;someStaticVar&quot;); \t\t \t\tpublic const menu : ChatMenuStructure = new ChatMenuStructure(); \t\t \t\tprivate static var _instance : ChatModel; \t\t \t\tpublic static function get instance() : ChatModel { \t\t\ttrace(&quot;Get instance start&quot;); \t\t\tif (!_instance) { \t\t\t\t_instance = new ChatModel(new T()); \t\t\t} \t\t\t \t\t\ttrace(&quot;Get instance end&quot;); \t\t\t \t\t\treturn _instance; \t\t} \t\t \t\tpublic function ChatModel(t : T) \t\t{ \t\t\ttrace(&quot;ChatModel contructor 1&quot;); \t\t} \t\t \t\tprivate static var getTraceCount : int = 0; \t\t \t\tpublic static function getTrace(str : String) : String { \t\t\tgetTraceCount++; \t\t\ttrace(&quot;getTrace #&quot; + getTraceCount, str); \t\t\treturn str; \t\t} \t} }  internal class T{ \t } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ChatMenuStructure.as<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"actionscript\">package { \tpublic class ChatMenuStructure \t{ \t\t \t\tpublic const chatMenuStructureConst : String = getTrace(&quot;chatMenuStructureConst&quot;); \t\t \t\tpublic var chatMenuStructureVar : String = getTrace(&quot;chatMenuStructureVar&quot;);  \t\t \t\tpublic function ChatMenuStructure() \t\t{ \t\t\ttrace(&quot;ChatMenuStructure constructor&quot;); \t\t} \t\t \t\tpublic static function getTrace(str : String) : String { \t\t\ttrace(&quot;ChatMenuStructure getTrace&quot;, str); \t\t\treturn str; \t\t} \t\t \t\tpublic function toString() : String { \t\t\treturn &quot;ChatMenuStructure instance&quot;; \t\t} \t\t\t \t} }<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">testSuperCall.mxml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"actionscript\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;s:Application xmlns:fx=&quot;http:\/\/ns.adobe.com\/mxml\/2009&quot;  \t\t\t   xmlns:s=&quot;library:\/\/ns.adobe.com\/flex\/spark&quot;  \t\t\t   xmlns:mx=&quot;library:\/\/ns.adobe.com\/flex\/mx&quot; minWidth=&quot;955&quot; minHeight=&quot;600&quot; \t\t\t   creationComplete=&quot;creationCompleteHandler()&quot;&gt; \t&lt;fx:Script&gt; \t\t&lt;![CDATA[ \t\t\t \t\t\tpublic var chatModel : ChatModel = ChatModel.instance; \t\t\t \t\t\tpublic const menu : ChatMenuStructure = chatModel.menu; \t\t\t \t\t\tprotected function creationCompleteHandler():void { \t\t\t\ttrace(&quot;menu is \\&quot;&quot; + String(menu) + &quot;\\&quot;&quot;); \t\t\t} \t\t\t \t\t]]&gt; \t&lt;\/fx:Script&gt; \t&lt;fx:Declarations&gt; \t\t&lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt; \t&lt;\/fx:Declarations&gt; &lt;\/s:Application&gt;  <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0432\u043e\u0442 \u043a\u0430\u043a\u0438\u0435 \u0442\u0440\u0435\u0439\u0441\u044b \u0432\u044b\u0448\u043b\u0438 (https:\/\/gist.github.com\/radistao\/5478426):  <\/p>\n<blockquote><p>getTrace <b>#1<\/b> someStaticConst<br \/>  getTrace <b>#2<\/b> someStaticVar<br \/>  Get instance start<br \/>  getTrace <b>#1<\/b> someConst<br \/>  getTrace <b>#2<\/b> someVar<br \/>  ChatMenuStructure getTrace chatMenuStructureConst<br \/>  ChatMenuStructure getTrace chatMenuStructureVar<br \/>  ChatMenuStructure constructor<br \/>  ChatModel contructor 1<br \/>  Get instance end<br \/>  menu is \u00abChatMenuStructure instance\u00bb  <\/p><\/blockquote>\n<p>  <a href=\"https:\/\/github.com\/radistao\/test-super-and-static\/commit\/1f0a6\">github.com\/radistao\/test-super-and-static\/commit\/1f0a6<\/a><\/p>\n<p>  \u041a\u043e\u0440\u043e\u0442\u043a\u043e \u0432\u044b\u0432\u043e\u0434\u044b \u043f\u043e \u0442\u0440\u0435\u0439\u0441\u0430\u043c:  <\/p>\n<ul>\n<li>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u043b\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043a\u0430\u043a \u0438 \u0432 \u044f\u0432\u0435 (\u041a\u041e \u043d\u0435 \u043e\u0448\u0438\u0431\u0430\u043b\u0441\u044f)<\/li>\n<li>\u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0443\u043a\u0442\u043e\u0440 \u2014 \u0432\u044b\u0437\u043e\u0432\u0443\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u00ab\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b\u00bb (\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u043e\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043a\u043b\u0430\u0441\u0441\u0443), \u0430 \u0437\u0430 \u043d\u0438\u043c\u0438 \u2014 \u0432\u0441\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u00ab\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b\u00bb. \u041a\u041e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u0443\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b.<\/li>\n<li>\u043d\u0430\u043b\u0438\u0447\u0438\u0435-\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 <code>&lt;b&gt;super()&lt;\/b&gt;<\/code> \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438-\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0440\u0435\u0439\u0441\u043e\u0432: \u043a\u043e\u043c\u043c\u0438\u0442 <a href=\"https:\/\/github.com\/radistao\/test-super-and-static\/commit\/7f930\">github.com\/radistao\/test-super-and-static\/commit\/7f930<\/a> \u0438 \u0442\u0440\u0435\u0439\u0441\u044b <a href=\"https:\/\/gist.github.com\/radistao\/5478435\">gist.github.com\/radistao\/5478435<\/a>)<\/li>\n<\/ul>\n<p>  \u041d\u041e!!!<br \/>  \u043f\u043e\u043a\u0430 \u044f \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u043b \u2014 \u044f \u0432 \u0432\u044b\u0437\u043e\u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434 <code>getTrace()<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0440\u0435\u0448\u0438\u043b \u0432\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0447\u0435\u0442\u0447\u0438\u043a <code>getTraceCount <\/code>\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043e\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u0441\u044f (\u0441\u0442\u0440\u043e\u043a\u0430 32 \u0444\u0430\u0439\u043b\u0430 ChatModel.as). \u0412\u0441\u0435 \u0447\u0442\u043e \u044f \u0441 \u043d\u0438\u043c \u0434\u0435\u043b\u0430\u043b \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u043b \u0438 \u0442\u0440\u0435\u0439\u0441\u0438\u043b \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 <code>getTrace()<\/code><\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0440\u0435\u0439\u0441\u044b:  <\/p>\n<blockquote><p>getTrace <b>#1<\/b> someStaticConst<br \/>  getTrace <b>#2<\/b> someStaticVar<br \/>  Get instance start<br \/>  getTrace <b>#1<\/b> someConst<br \/>  getTrace <b>#2<\/b> someVar<\/p><\/blockquote>\n<p>  \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <code>getTraceCount <\/code>\u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c 2 \u0440\u0430\u0437\u0430! WAT?<br \/>  <img decoding=\"async\" src=\"http:\/\/gifsforum.com\/images\/image\/wtf\/grand\/dude_wait_wat.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041e\u043a\u043b\u0438\u043c\u0430\u0432\u0448\u0438\u0441\u044c \u0438 \u0441\u043e\u0431\u0440\u0430\u0432 \u043e\u0441\u0442\u0430\u0442\u043a\u0438 \u043c\u043e\u0435\u0433\u043e \u0440\u0430\u0437\u043e\u0440\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0441\u043a\u0430 \u044f \u043d\u0430\u0447\u0430\u043b \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0438\u043b\u0438\u0442\u044c \u0438 \u0438\u0441\u043a\u0430\u0442\u044c, WTF! \u041d\u0443, \u0432\u043e\u0431\u0449\u0435\u043c, \u0443\u043f\u0443\u0441\u0442\u0438\u0432 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0442\u0430\u043d\u0446\u044b \u0441 \u0431\u0443\u0431\u043d\u043e\u043c \u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0434\u0443\u0445\u043e\u0432 \u0443\u043c\u0435\u0440\u0448\u0438\u0445 \u0444\u043b\u0435\u043a\u0441\u0435\u0440\u043e\u0432, \u044f \u043f\u043e\u043d\u044f\u043b \u0432 \u0447\u0435\u043c \u0442\u0440\u0430\u0431\u043b\u0430:<\/p>\n<blockquote><p><code>private static var getTraceCount : int = 0;<\/code> <\/p><\/blockquote>\n<p>  \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435 \u043d\u0438\u0436\u0435 \u043f\u0435\u0440\u0432\u044b\u0445 \u0434\u0432\u0443\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <i>getTrace()<\/i>. \u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0432 \u044d\u0442\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0441\u0430\u043c\u044b\u0439 \u00ab\u0432\u0435\u0440\u0445\u00bb \u043a\u043b\u0430\u0441\u0441\u0430 (\u043a\u043e\u0434\u0430) \u2014 \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0430\u043a\u0438 \u0447\u0430\u0441\u044b (https:\/\/github.com\/radistao\/test-super-and-static\/commit\/a0dcd):  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ChatMenuStructure.as<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"actionscript\">package { \tpublic class ChatModel \t{ \t\t \t\tprivate static var getTraceCount : int = 0; \t\t \t\tpublic var someConst : String = getTrace(&quot;someConst&quot;); \t\tpublic var someVar : String = getTrace(&quot;someVar&quot;); \t\t \t\tpublic static const someStaticConst : String = getTrace(&quot;someStaticConst&quot;); \t\tpublic static var someStaticVar : String = getTrace(&quot;someStaticVar&quot;); \t\t \t\tpublic const menu : ChatMenuStructure = new ChatMenuStructure(); \t\t \t\tprivate static var _instance : ChatModel; \t\t \t\tpublic static function get instance() : ChatModel { \t\t\ttrace(&quot;Get instance start&quot;); \t\t\tif (!_instance) { \t\t\t\t_instance = new ChatModel(new T()); \t\t\t} \t\t\t \t\t\ttrace(&quot;Get instance end&quot;); \t\t\t \t\t\treturn _instance; \t\t} \t\t \t\tpublic function ChatModel(t : T) \t\t{ \t\t\ttrace(&quot;ChatModel contructor before super()&quot;); \t\t\tsuper(); \t\t\ttrace(&quot;ChatModel contructor after super()&quot;); \t\t} \t\t \t\tpublic static function getTrace(str : String) : String { \t\t\tgetTraceCount++; \t\t\ttrace(&quot;getTrace #&quot; + getTraceCount, str); \t\t\treturn str; \t\t} \t} }  internal class T{ \t } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0440\u0435\u0439\u0441\u044b (https:\/\/gist.github.com\/radistao\/5478443):  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0440\u0435\u0439\u0441\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"actionscript\">getTrace &lt;b&gt;#1&lt;\/b&gt; someStaticConst getTrace &lt;b&gt;#2&lt;\/b&gt; someStaticVar Get instance start getTrace &lt;b&gt;#3&lt;\/b&gt; someConst getTrace &lt;b&gt;#4&lt;\/b&gt; someVar ChatMenuStructure getTrace chatMenuStructureConst ChatMenuStructure getTrace chatMenuStructureVar ChatMenuStructure constructor ChatModel contructor before super() ChatModel contructor after super() Get instance end menu is &quot;ChatMenuStructure instance&quot; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412\u043e\u0431\u0449\u0435\u043c, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u0430:  <\/p>\n<ol>\n<li>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>getTrace <\/code> \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>someStaticConst<\/code>. \u0412 \u044d\u0442\u043e\u043c <code>getTrace() <\/code>\u0434\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f <code>getTraceCount<\/code>, \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0442\u0441\u044f \u0434\u043e 1<\/li>\n<li>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>getTrace <\/code>\u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>someStaticVar<\/code>. \u0412 \u044d\u0442\u043e\u043c <code>getTrace()<\/code> \u0434\u0435\u0440\u0433\u0430\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <code>getTraceCount <\/code>\u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0442\u0441\u044f \u0434\u043e 2<\/li>\n<li>\u0438 \u0442\u0443\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u2014 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f<i> private static var getTraceCount: int = 0;<\/i> \u0418 \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 <code>getTraceCount <\/code>\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0431\u0435\u0437\u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u043e \u0441\u0435\u0442\u0438\u0442\u0441\u044f \u0441\u043d\u043e\u0432\u0430 \u0432 0 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0441 \u043d\u0430\u0447\u0430\u043b\u0430!<\/li>\n<\/ol>\n<p>  <img decoding=\"async\" src=\"http:\/\/img4.joyreactor.cc\/pics\/comment\/%D0%B0%D0%B2%D1%82%D0%BE%D0%BC%D0%BE%D0%B1%D0%B8%D0%BB%D1%8C-%D0%B0%D0%B2%D1%82%D0%BE%D0%BF%D1%80%D0%B8%D0%BA%D0%BE%D0%BB%D1%8B-wtf-%D0%BF%D0%B5%D1%81%D0%BE%D1%87%D0%BD%D0%B8%D1%86%D0%B0-379404.jpeg\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u00ab\u0432\u043d\u0438\u0437\u0443 \u043a\u043e\u0434\u0430\u00bb \u0438 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u0440\u0433\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u043d\u044c\u0448\u0435, \u0442\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430.<\/p>\n<p>  \u0412\u043e\u0442 \u043c\u043d\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u0442\u043e \u0432\u0438\u043d\u043e\u0432\u0430\u0442 (\u0438 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c): \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u044f\u0432\u0430-\u043c\u0430\u0448\u0438\u043d\u0430 \u0438\u043b\u0438 \u0444\u043b\u0435\u0448-\u043f\u043b\u0435\u0435\u0440? <\/p>\n<p>  \u0420\u0430\u0434\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u043f\u043e-\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0449\u0435 \u0441 \u043d\u0435\u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 (https:\/\/github.com\/radistao\/test-super-and-static\/commit\/08894):<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">GetTracesClass.as<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"actionscript\">package { \tpublic class GetTracesClass \t{ \t\tprivate static var constructorCalls : int = 1; \t\t \t\tprivate var instanceNumber : int; \t\t \t\tpublic function GetTracesClass() \t\t{ \t\t\ttrace(&quot;GetTracesClass constructor called &quot; + String(constructorCalls) + &quot; time(s)&quot;); \t\t\tinstanceNumber = constructorCalls; \t\t\tconstructorCalls++; \t\t} \t\t \t\tpublic function toString() : String { \t\t\treturn &quot;GetTracesClass instance #&quot; + String(instanceNumber); \t\t} \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ChatModel.as<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"actionscript\">package { \tpublic class ChatModel \t{ \t\t \t\tpublic var someConst : String = getTrace(&quot;someConst&quot;); \t\tpublic var someVar : String = getTrace(&quot;someVar&quot;); \t\t \t\tpublic static const someStaticConst : String = getTrace(&quot;someStaticConst&quot;); \t\tpublic static var someStaticVar : String = getTrace(&quot;someStaticVar&quot;); \t\t \t\tpublic const menu : ChatMenuStructure = new ChatMenuStructure(); \t\t \t\tprivate static var _instance : ChatModel; \t\t \t\tpublic static function get instance() : ChatModel { \t\t\ttrace(&quot;Get instance start&quot;); \t\t\tif (!_instance) { \t\t\t\t_instance = new ChatModel(new T()); \t\t\t} \t\t\t \t\t\ttrace(&quot;Get instance end&quot;); \t\t\t \t\t\treturn _instance; \t\t} \t\t \t\tpublic function ChatModel(t : T) \t\t{ \t\t\ttrace(&quot;ChatModel contructor before super()&quot;); \t\t\tsuper(); \t\t\ttrace(&quot;ChatModel contructor after super()&quot;); \t\t} \t\t \t\tprivate static var getTraceCount : GetTracesClass = new GetTracesClass(); \t\t \t\tpublic static function getTrace(str : String) : String { \t\t\ttrace(&quot;getTrace #\\&quot;&quot; + getTraceCount + &quot;\\&quot;&quot;, str); \t\t\treturn str; \t\t} \t} }  internal class T{ \t } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0440\u0435\u0439\u0441\u044b (https:\/\/gist.github.com\/radistao\/5478479):   <\/p>\n<blockquote><p>getTrace #\u00abnull\u00bb someStaticConst<br \/>  getTrace #\u00abnull\u00bb someStaticVar<br \/>  GetTracesClass constructor called 1 time(s)<br \/>  Get instance start<br \/>  getTrace #\u00abGetTracesClass instance #1\u00bb someConst<br \/>  getTrace #\u00abGetTracesClass instance #1\u00bb someVar<br \/>  ChatMenuStructure getTrace chatMenuStructureConst<br \/>  ChatMenuStructure getTrace chatMenuStructureVar<br \/>  ChatMenuStructure constructor<br \/>  ChatModel contructor before super()<br \/>  ChatModel contructor after super()<br \/>  Get instance end<br \/>  menu is \u00abChatMenuStructure instance\u00bb  <\/p><\/blockquote>\n<p>  \u0422\u0430\u043c \u0443\u0436\u0435 \u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e, \u0445\u043e\u0442\u044f \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0442\u0443\u043f\u043e: \u043f\u0435\u0440\u0432\u044b\u0435 2 \u0432\u044b\u0437\u043e\u0432\u0430 <code>getTrace() <\/code>\u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0441\u0435\u0442\u044f\u0442 <code>getTraceCount<\/code>, \u0445\u043e\u0442\u044f \u0438 \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u043a \u043d\u0435\u043c, \u0430 \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0435 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0434\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>getTraceCount  <\/code>\u0432 \u043d\u0430\u0447\u0430\u043b\u0430 \u2014 \u0432\u0441\u0435 \u0438\u0434\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e (https:\/\/gist.github.com\/radistao\/5478482)<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/fuuka.warosu.org\/data\/lit\/img\/0028\/37\/1343159444965.jpg\" alt=\"image\"\/><br \/>  (\u0423 \u043c\u0435\u043d\u044f \u0443\u0436\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u044b\u0432\u0430 \u043c\u043e\u0441\u043a\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u0443 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u044f \u0432\u0441\u0442\u0430\u0432\u0438\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a!)<\/p>\n<p>  \u041f\u043e\u0442\u043e\u043c \u0435\u0449\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0441 <b>Number <\/b> \u2014 \u0442\u0430 \u0436\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u0430, \u043a\u0430\u043a \u0438 \u0441 <b>int<\/b>. <br \/>  \u041f\u043e\u0442\u043e\u043c \u0435\u0449\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>getTraceCount <\/code>\u043d\u0435 \u043d\u0443\u043b\u0435\u043c, \u0430 1 (\u0442.\u0435., \u043d\u0435 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c): \u0442\u043e\u0433\u0434\u0430 \u0432 \u0442\u0440\u0435\u0439\u0441\u0430\u0445 \u0432\u044b\u043f\u0430\u043b\u043e &quot;<code>2, 3, 2, 3<\/code>&quot; (\u0442.\u0435., \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437, \u0432\u0441\u0435-\u0442\u0430\u043a\u0438, \u0431\u044b\u043b\u043e \u0432\u0437\u044f\u0442\u043e \u043d\u0435 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f <b>int<\/b>, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0435\u043c\u0443 \u0441\u0435\u0442\u0438\u0442\u0441\u044f \u0432 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0435).<\/p>\n<p>  \u041d\u0430 \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c? \u042f \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u044e, \u043d\u043e \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e, \u0447\u0442\u043e, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u043a\u0430\u043a\u0438\u0435-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u043e\u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0435\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b.      \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/178367\/\"> http:\/\/habrahabr.ru\/post\/178367\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0418\u0433\u0440\u0430\u044f\u0441\u044c \u0441 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u0430\u043c\u0438-\u0441\u0442\u0430\u0442\u0438\u043a\u043e\u0439-\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c\u0438 \u0432\u043e \u0444\u043b\u0435\u043a\u0441\u0435, \u0432\u043e\u0442 \u043d\u0430 \u0447\u0442\u043e \u043d\u0430\u043f\u043e\u0440\u043e\u043b\u0441\u044f:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-178367","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/178367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=178367"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/178367\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=178367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=178367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=178367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}