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

feat: Add __assign ts-helper to support using spread operator by vakrilov · Pull Request #6336 · NativeScript/NativeScript · GitHub

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

Filter by extension

Filter by extension .ts  (4) All 1 file type selected
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
3 changes: 3 additions & 0 deletions tests/app/testRunner.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 @@ -33,6 +33,9 @@ export function isRunningOnEmulator(): boolean {

export const allTests = {};

import * as tsTests from "./typescript/ts-tests";
allTests["TYPESCRIPT"] = tsTests;

import * as domNodeTest from "./debugger/dom-node-tests";
allTests["DOM-NODE"] = domNodeTest;

Expand Down
9 changes: 9 additions & 0 deletions tests/app/typescript/ts-tests.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,9 @@
import * as TKUnit from "../TKUnit";

export function test_typescript_spread_operator() {
const a = { first: "test1", second: "test2" };
const b = { ...a, second: "newValue" };

TKUnit.assertEqual(b.first, "test1");
TKUnit.assertEqual(b.second, "newValue");
}
2 changes: 1 addition & 1 deletion 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,5 +1,5 @@
// Required by TypeScript compiler
require("./decorators");
require("./ts-helpers");

// Required by V8 snapshot generator
if (!global.__extends) {
Expand Down
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 @@ -30,3 +30,17 @@ if (typeof (<any>global).__param !== "function") {
return function (target, key) { decorator(target, key, paramIndex); }
};
}

if (typeof (<any>global).__assign !== "function") {
(<any>global).__assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p)) {
t[p] = s[p];
}
}
}
return t;
};
}

Back | FazBrowse Home | New Git URL