FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(tslib): add tslib helpers to global by m-abs · Pull Request #6351 · NativeScript/NativeScript · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .json  (4) .ts  (5) All 2 file types selected
Only manifest files
Deleted files Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"shelljs": "^0.7.0",
"source-map-support": "^0.4.17",
"time-grunt": "1.3.0",
"tslib": "^1.7.1",
"tslib": "^1.9.3",
"tslint": "^5.4.3",
"typedoc": "^0.5.10",
"typedoc-plugin-external-module-name": "git://github.com/PanayotCankov/typedoc-plugin-external-module-name.git#with-js",
Expand Down
3 changes: 2 additions & 1 deletion tests/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
}
},
"dependencies": {
"tns-core-modules": "*"
"tns-core-modules": "*",
"tslib": "^1.9.3"
},
"devDependencies": {
"babel-traverse": "6.9.0",
Expand Down
32 changes: 0 additions & 32 deletions tns-core-modules/globals/decorators.ts

This file was deleted.

15 changes: 1 addition & 14 deletions tns-core-modules/globals/globals.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
// Required by TypeScript compiler
require("./decorators");

// Required by V8 snapshot generator
if (!global.__extends) {
global.__extends = function (d, b) {
for (var p in b) {
if (b.hasOwnProperty(p)) {
d[p] = b[p];
}
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}
require("./ts-helpers");

// This method iterates all the keys in the source exports object and copies them to the destination exports one.
// Note: the method will not check for naming collisions and will override any already existing entries in the destination exports.
Expand Down
30 changes: 30 additions & 0 deletions tns-core-modules/globals/ts-helpers.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Required by V8 snapshot generator
if (!global.__extends) {
global.__extends = function (d, b) {
for (var p in b) {
if (b.hasOwnProperty(p)) {
d[p] = b[p];
}
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
}

import * as tslib from "tslib";

// Bind the tslib helpers to global scope.
// This is needed when we don't use importHelpers, which
// breaks extending native-classes
for (const fnName of Object.keys(tslib)) {
if (typeof tslib[fnName] !== "function") {
continue;
}

if (fnName in global) {
// Don't override globals that are already defined (ex. __extends)
continue;
}

global[fnName] = tslib[fnName];
}
2 changes: 1 addition & 1 deletion tns-core-modules/inspector_modules.ios.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
console.log("Loading inspector modules...");
require("./globals/decorators");
require("./globals/ts-helpers");
require("./debugger/webinspector-network");
require("./debugger/webinspector-dom");
require("./debugger/webinspector-css");
Expand Down
3 changes: 2 additions & 1 deletion tns-core-modules/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"license": "Apache-2.0",
"typings": "tns-core-modules.d.ts",
"dependencies": {
"tns-core-modules-widgets": "next"
"tns-core-modules-widgets": "next",
"tslib": "^1.9.3"
},
"devDependencies": {
"@types/node": "~7.0.5",
Expand Down
4 changes: 2 additions & 2 deletions tns-core-modules/ui/styling/style-properties.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ export function transformConverter(text: string): TransformFunctionsInfo {

const usedTransforms = transformations.map(t => t.property);
if (!hasDuplicates(usedTransforms)) {
const fullTransformations = Object.assign({}, IDENTITY_TRANSFORMATION);
const fullTransformations = { ...IDENTITY_TRANSFORMATION };
transformations.forEach(transform => {
fullTransformations[transform.property] = transform.value;
});
Expand Down Expand Up @@ -1098,4 +1098,4 @@ export const visibilityProperty = new CssProperty<Style, Visibility>({
target.view.isCollapsed = (newValue === Visibility.COLLAPSE);
}
});
visibilityProperty.register(Style);
visibilityProperty.register(Style);
2 changes: 1 addition & 1 deletion tns-platform-declarations/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
},
"homepage": "https://github.com/NativeScript/NativeScript#readme",
"devDependencies": {
"typescript": "^2.6.1"
"typescript": "~2.6.1"
}
}

Back | FazBrowse Home | New Git URL