(thiz)
| 19 | |
| 20 | // For backward compatibility. |
| 21 | var __native = function (thiz) { |
| 22 | // we are setting the __container__ property to the base class when the super method is called |
| 23 | // if the constructor returns the __native(this) call we will use the old implementation |
| 24 | // copying all the properties to the result |
| 25 | // otherwise if we are using the result from the super() method call we won't need such logic |
| 26 | // as thiz already contains the parent properties |
| 27 | // this way we now support both implementations in typescript generated constructors: |
| 28 | // 1: super(); return __native(this); |
| 29 | // 2: return super() || this; |
| 30 | if (thiz.__container__) { |
| 31 | var result = thiz.__proto__; |
| 32 | |
| 33 | for (var prop in thiz) { |
| 34 | if (thiz.hasOwnProperty(prop)) { |
| 35 | thiz.__proto__[prop] = thiz[prop]; |
| 36 | delete thiz[prop]; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | thiz.constructor = undefined; |
| 41 | thiz.__proto__ = undefined; |
| 42 | Object.freeze(thiz); |
| 43 | Object.preventExtensions(thiz); |
| 44 | return result; |
| 45 | } else { |
| 46 | return thiz; |
| 47 | } |
| 48 | }; |
| 49 | |
| 50 | var __extends = function (Child, Parent) { |
| 51 | var extendNativeClass = !!Parent.extend && (Parent.extend.toString().indexOf("[native code]") > -1); |
no outgoing calls
no test coverage detected