Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(__extends): Use correct behaviour with null prototype #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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