Skip to content

Commit

Permalink
fix(__extends): Use correct behaviour with null prototype
Browse files Browse the repository at this point in the history
Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
  • Loading branch information
ExE-Boss and rbuckton committed Jan 7, 2021
1 parent 54a056a commit 5f74ae1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tslib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
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
5 changes: 2 additions & 3 deletions tslib.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ var extendStatics = function(d, b) {
export function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
function __() {}
(d.prototype = b ? (extendStatics(d, b), __.prototype = b.prototype, new __()) : Object.create(b)).constructor = d;
}

export var __assign = function() {
Expand Down
5 changes: 2 additions & 3 deletions tslib.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ var __createBinding;
__extends = function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
function __() {}
(d.prototype = b ? (extendStatics(d, b), __.prototype = b.prototype, new __()) : Object.create(b)).constructor = d;
};

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

0 comments on commit 5f74ae1

Please sign in to comment.