From 12fca3bb5aa4a500d287621856a674379ed599dc Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 13 May 2020 12:29:03 -0700 Subject: [PATCH 1/5] Revert changes to pre-3.9 behavior. --- tslib.d.ts | 1 - tslib.es6.js | 20 +++----------------- tslib.js | 26 +++++--------------------- 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/tslib.d.ts b/tslib.d.ts index 57ad995..6310fbf 100644 --- a/tslib.d.ts +++ b/tslib.d.ts @@ -34,4 +34,3 @@ export declare function __importStar(mod: T): T; export declare function __importDefault(mod: T): T | { default: T }; export declare function __classPrivateFieldGet(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V; export declare function __classPrivateFieldSet(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V; -export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; diff --git a/tslib.es6.js b/tslib.es6.js index ce26163..1b8c2b3 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -103,16 +103,8 @@ export function __generator(thisArg, body) { } } -export const __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - export function __exportStar(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } export function __values(o) { @@ -193,17 +185,11 @@ export function __makeTemplateObject(cooked, raw) { return cooked; }; -const __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - export function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; return result; } diff --git a/tslib.js b/tslib.js index 50dc71c..5136250 100644 --- a/tslib.js +++ b/tslib.js @@ -35,7 +35,6 @@ var __importStar; var __importDefault; var __classPrivateFieldGet; var __classPrivateFieldSet; -var __createBinding; (function (factory) { var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; if (typeof define === "function" && define.amd) { @@ -143,18 +142,10 @@ var __createBinding; } }; - __exportStar = function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); + __exportStar = function (m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; }; - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - __values = function (o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); @@ -233,17 +224,11 @@ var __createBinding; return cooked; }; - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - __importStar = function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; return result; }; @@ -264,7 +249,7 @@ var __createBinding; } privateMap.set(receiver, value); return value; - }; + } exporter("__extends", __extends); exporter("__assign", __assign); @@ -275,7 +260,6 @@ var __createBinding; exporter("__awaiter", __awaiter); exporter("__generator", __generator); exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); exporter("__values", __values); exporter("__read", __read); exporter("__spread", __spread); From e6dc41c6d73ee6aa45306682cbd07b941f09aea9 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 13 May 2020 12:29:49 -0700 Subject: [PATCH 2/5] Update version number. --- README.md | 2 +- bower.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c14f87c..2038cf9 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ For JSPM users: "importHelpers": true, "baseUrl": "./", "paths": { - "tslib" : ["jspm_packages/npm/tslib@1.12.0/tslib.d.ts"] + "tslib" : ["jspm_packages/npm/tslib@1.13.0/tslib.d.ts"] } } } diff --git a/bower.json b/bower.json index b0363e0..dd46530 100644 --- a/bower.json +++ b/bower.json @@ -4,7 +4,7 @@ "Microsoft Corp." ], "homepage": "http://typescriptlang.org/", - "version": "1.12.0", + "version": "1.13.0", "license": "0BSD", "description": "Runtime library for TypeScript helper functions", "keywords": [ diff --git a/package.json b/package.json index d2edd79..72a6455 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "tslib", "author": "Microsoft Corp.", "homepage": "https://www.typescriptlang.org/", - "version": "1.12.0", + "version": "1.13.0", "license": "0BSD", "description": "Runtime library for TypeScript helper functions", "keywords": [ From ce3462e9da1da80ef7884b94c611998eaa833f33 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 13 May 2020 15:47:46 -0700 Subject: [PATCH 3/5] Re-add '__createBinding'. --- tslib.d.ts | 1 + tslib.es6.js | 5 +++++ tslib.js | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/tslib.d.ts b/tslib.d.ts index 6310fbf..0756b28 100644 --- a/tslib.d.ts +++ b/tslib.d.ts @@ -34,3 +34,4 @@ export declare function __importStar(mod: T): T; export declare function __importDefault(mod: T): T | { default: T }; export declare function __classPrivateFieldGet(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V; export declare function __classPrivateFieldSet(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V; +export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; \ No newline at end of file diff --git a/tslib.es6.js b/tslib.es6.js index 1b8c2b3..02484cb 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -103,6 +103,11 @@ export function __generator(thisArg, body) { } } +export function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +} + export function __exportStar(m, exports) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } diff --git a/tslib.js b/tslib.js index 5136250..f89909f 100644 --- a/tslib.js +++ b/tslib.js @@ -12,6 +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. ***************************************************************************** */ + /* global global, define, System, Reflect, Promise */ var __extends; var __assign; @@ -35,6 +36,7 @@ var __importStar; var __importDefault; var __classPrivateFieldGet; var __classPrivateFieldSet; +var __createBinding; (function (factory) { var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; if (typeof define === "function" && define.amd) { @@ -142,6 +144,11 @@ var __classPrivateFieldSet; } }; + __createBinding = function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }; + __exportStar = function (m, exports) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; }; @@ -260,6 +267,7 @@ var __classPrivateFieldSet; exporter("__awaiter", __awaiter); exporter("__generator", __generator); exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); exporter("__values", __values); exporter("__read", __read); exporter("__spread", __spread); From 0587b2af6880b43523de666d553bb81f13d049da Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 13 May 2020 15:50:35 -0700 Subject: [PATCH 4/5] Add back 'p !== default' --- tslib.es6.js | 2 +- tslib.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tslib.es6.js b/tslib.es6.js index 02484cb..0e0d8d0 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -109,7 +109,7 @@ export function __createBinding(o, m, k, k2) { } export function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; } export function __values(o) { diff --git a/tslib.js b/tslib.js index f89909f..18aa189 100644 --- a/tslib.js +++ b/tslib.js @@ -150,7 +150,7 @@ var __createBinding; }; __exportStar = function (m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; }; __values = function (o) { From 7b69d91f43032526bfa17a5292f0086ff3d7281c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 13 May 2020 15:52:14 -0700 Subject: [PATCH 5/5] Semicolon --- tslib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tslib.js b/tslib.js index 18aa189..e5b7c9b 100644 --- a/tslib.js +++ b/tslib.js @@ -256,7 +256,7 @@ var __createBinding; } privateMap.set(receiver, value); return value; - } + }; exporter("__extends", __extends); exporter("__assign", __assign);