Skip to content

Commit

Permalink
fix(__extends): Use correct behaviour with null prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Jan 15, 2020
1 parent 3cf8ae0 commit f073ee5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tslib.d.ts
Expand Up @@ -12,7 +12,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
export declare function __extends(d: Function, b: Function): void;
export declare function __extends(d: Function, b: Function | null): void;
export declare function __assign(t: any, ...sources: any[]): any;
export declare function __rest(t: any, propertyNames: (string | symbol)[]): any;
export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;
Expand Down
7 changes: 6 additions & 1 deletion tslib.es6.js
Expand Up @@ -22,9 +22,14 @@ var extendStatics = function(d, b) {
};

export function __extends(d, b) {
if (b === null) {
d.prototype = Object.create(b);
return;
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
__.prototype = b.prototype;
d.prototype = new __();
}

export var __assign = function() {
Expand Down
7 changes: 6 additions & 1 deletion tslib.js
Expand Up @@ -64,9 +64,14 @@ var __classPrivateFieldSet;
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };

__extends = function (d, b) {
if (b === null) {
d.prototype = Object.create(b);
return;
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
__.prototype = b.prototype;
d.prototype = new __();
};

__assign = Object.assign || function (t) {
Expand Down

0 comments on commit f073ee5

Please sign in to comment.