Skip to content

Commit f9eaed7

Browse files
committed
Merge branch 'master' into reachabilityChecks
2 parents 7b12617 + fb97e2f commit f9eaed7

File tree

78 files changed

+28579
-24729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+28579
-24729
lines changed

CONTRIBUTING.md

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
## Contributing bug fixes
2+
23
TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort.
34

45
## Contributing features
6+
57
Features (things that add new or improved functionality to TypeScript) may be accepted, but will need to first be approved (marked as "Milestone == Community" by a TypeScript coordinator with the message "Approved") in the suggestion issue. Features with language design impact, or that are adequately satisfied with external tools, will not be accepted.
68

79
Design changes will not be accepted at this time. If you have a design change proposal, please log a suggestion issue.
810

911
## Legal
12+
1013
You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright.
1114

1215
Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to <[email protected]>. Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request.
1316

1417
## Housekeeping
18+
1519
Your pull request should:
1620

1721
* Include a description of what your change intends to do
@@ -29,7 +33,8 @@ Your pull request should:
2933
* To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your git configuration
3034

3135
## Running the Tests
32-
To run all tests, invoke the runtests target using jake:
36+
37+
To run all tests, invoke the `runtests` target using jake:
3338

3439
```Shell
3540
jake runtests
@@ -47,23 +52,42 @@ e.g. to run all compiler baseline tests:
4752
jake runtests tests=compiler
4853
```
4954

50-
or to run specifc test: `tests\cases\compiler\2dArrays.ts`
55+
or to run a specific test: `tests\cases\compiler\2dArrays.ts`
5156

5257
```Shell
5358
jake runtests tests=2dArrays
5459
```
5560

61+
## Debugging the tests
62+
63+
To debug the tests, invoke the `runtests-browser` task from jake.
64+
You will probably only want to debug one test at a time:
65+
66+
```Shell
67+
jake runtests-browser tests=2dArrays
68+
```
69+
70+
You can specify which browser to use for debugging. Currently Chrome and IE are supported:
71+
72+
```Shell
73+
jake runtests-browser tests=2dArrays browser=chrome
74+
```
75+
76+
You can debug with VS Code or Node instead with `jake runtests debug=true`:
77+
78+
```Shell
79+
jake runtests tests=2dArrays debug=true
80+
```
81+
5682
## Adding a Test
57-
To add a new testcase, simply place a `.ts` file in `tests\cases\compiler` containing code that exemplifies the bugfix or change you are making.
5883

59-
These files support metadata tags in the format `// @metaDataName: value`. The supported names and values are:
84+
To add a new test case, simply place a `.ts` file in `tests\cases\compiler` containing code that exemplifies the bugfix or change you are making.
6085

61-
* `comments`, `sourcemap`, `noimplicitany`, `declaration`: true or false (corresponds to the compiler command-line options of the same name)
62-
* `target`: ES3 or ES5 (same as compiler)
63-
* `out`, outDir: path (same as compiler)
64-
* `module`: local, commonjs, or amd (local corresponds to not passing any compiler --module flag)
65-
* `fileName`: path
66-
* These tags delimit sections of a file to be used as separate compilation units. They are useful for tests relating to modules. See below for examples.
86+
These files support metadata tags in the format `// @metaDataName: value`.
87+
The supported names and values are the same as those supported in the compiler itself, with the addition of the `fileName` flag.
88+
`fileName` tags delimit sections of a file to be used as separate compilation units.
89+
They are useful for tests relating to modules.
90+
See below for examples.
6791

6892
**Note** that if you have a test corresponding to a specific spec compliance item, you can place it in `tests\cases\conformance` in an appropriately-named subfolder.
6993
**Note** that filenames here must be distinct from all other compiler testcase names, so you may have to work a bit to find a unique name if it's something common.
@@ -86,6 +110,7 @@ var x = g();
86110
One can also write a project test, but it is slightly more involved.
87111

88112
## Managing the Baselines
113+
89114
Compiler testcases generate baselines that track the emitted `.js`, the errors produced by the compiler, and the type of each expression in the file. Additionally, some testcases opt in to baselining the source map output.
90115

91116
When a change in the baselines is detected, the test will fail. To inspect changes vs the expected baselines, use
@@ -102,4 +127,4 @@ jake baseline-accept
102127

103128
to establish the new baselines as the desired behavior. This will change the files in `tests\baselines\reference`, which should be included as part of your commit. It's important to carefully validate changes in the baselines.
104129

105-
**Note** that baseline-accept should only be run after a full test run! Accepting baselines after running a subset of tests will delete baseline files for the tests that didn't run.
130+
**Note** that `baseline-accept` should only be run after a full test run! Accepting baselines after running a subset of tests will delete baseline files for the tests that didn't run.

lib/lib.core.es6.d.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3965,7 +3965,34 @@ interface ObjectConstructor {
39653965
* Copy the values of all of the enumerable own properties from one or more source objects to a
39663966
* target object. Returns the target object.
39673967
* @param target The target object to copy to.
3968-
* @param sources One or more source objects to copy properties from.
3968+
* @param source The source object from which to copy properties.
3969+
*/
3970+
assign<T, U>(target: T, source: U): T & U;
3971+
3972+
/**
3973+
* Copy the values of all of the enumerable own properties from one or more source objects to a
3974+
* target object. Returns the target object.
3975+
* @param target The target object to copy to.
3976+
* @param source1 The first source object from which to copy properties.
3977+
* @param source2 The second source object from which to copy properties.
3978+
*/
3979+
assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
3980+
3981+
/**
3982+
* Copy the values of all of the enumerable own properties from one or more source objects to a
3983+
* target object. Returns the target object.
3984+
* @param target The target object to copy to.
3985+
* @param source1 The first source object from which to copy properties.
3986+
* @param source2 The second source object from which to copy properties.
3987+
* @param source3 The third source object from which to copy properties.
3988+
*/
3989+
assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
3990+
3991+
/**
3992+
* Copy the values of all of the enumerable own properties from one or more source objects to a
3993+
* target object. Returns the target object.
3994+
* @param target The target object to copy to.
3995+
* @param sources One or more source objects from which to copy properties
39693996
*/
39703997
assign(target: any, ...sources: any[]): any;
39713998

0 commit comments

Comments
 (0)