15025 Commits

Author SHA1 Message Date
Nathan Shively-Sanders
01969475cf Improve nested destructuring test for ESNext emit
Now with object destructuring inside array destructuring inside object
destructuring! Each with their own array/object rest!

Also updates baselines.
2016-11-09 10:51:56 -08:00
Nathan Shively-Sanders
214ce38a6a Downlevel array destructuring to ES6 in object rest
Previously array destructuring inside an object destructuring with an
object rest would downlevel the array destructuring to ES5. This breaks
if the code that targets ES2015 is using iterators instead of arrays
since iterators don't support [0] or .slice that the ES5 emit uses.
2016-11-09 10:47:54 -08:00
Nathan Shively-Sanders
9977936190 Do not emit __rest for --target esnext 2016-11-07 11:34:37 -08:00
Nathan Shively-Sanders
609cd0016b Merge branch 'object-spread' into object-rest 2016-11-07 11:10:29 -08:00
Nathan Shively-Sanders
f03fecbd31 Merge branch 'master' into object-spread 2016-11-07 11:02:49 -08:00
Nathan Shively-Sanders
83e95d43f8 Revert unneeded change and comments per PR 2016-11-07 11:00:24 -08:00
Nathan Shively-Sanders
d4a5b0855c Add --target esnext tests and update baselines 2016-11-07 09:56:48 -08:00
Nathan Shively-Sanders
7b9a42f995 Add --target esnext
Currently, this disables the rest and spread transforms. This will
change as proposals enter and leave stage 3.
2016-11-07 09:54:48 -08:00
Nathan Shively-Sanders
6a82ae4cbb Add SpreadAssignment to visitors
1. visitNode
2. reduceNode
3. emit

This fixes an emit bug for setters.
2016-11-07 09:04:00 -08:00
Nathan Shively-Sanders
a84c7aeea4 Rename SpreadElementExpression -> SpreadAssignment
and SpreadExpression (formerly SpreadElementExpression) -> SpreadElement
2016-11-07 08:36:03 -08:00
Vladimir Matveev
ed4fead087 add missing bind calls to properly set parent on token nodes (#12057) 2016-11-04 21:54:22 -07:00
Nathan Shively-Sanders
a55ed26d2b Spread any types to any 2016-11-04 16:06:33 -07:00
Nathan Shively-Sanders
4c365bd76a Move transformFunctionBody to factory
It is shared by es2015 and esNext transformers.

This commit just adds a convertObjectRest flag to be passed on to
flattenDestructuring functions, as well as adding necessary parameters
to use the code outside a transformer.
2016-11-04 13:56:28 -07:00
Nathan Shively-Sanders
4337369ed4 Update improved baselines 2016-11-04 11:07:18 -07:00
Nathan Shively-Sanders
cc342d12e7 Move convertForOf to factory for esnext and es2015
Saves a lot of duplicated code
2016-11-04 11:06:56 -07:00
Sheetal Nandi
4a906143c6 Merge pull request #11998 from Microsoft/unusedProperty
Mark property referenced in the destructuring as referenced
2016-11-04 10:42:05 -07:00
Nathan Shively-Sanders
71f3157a35 Address PR comments
1. Remove extra line in __rest shim.
2. Improve __rest vs __assign check for destructuring assignment.
2016-11-04 09:03:03 -07:00
Ron Buckton
defc0537ae Merge pull request #12039 from Microsoft/fix12010
Ensure transformFlags are correct before visiting a node.
2016-11-03 23:38:52 -07:00
Zhengbo Li
1c004bf317 Port #12027, #11980 and #11932 to master (#12037)
* add test for the fix for overwrite emitting error

* cr feedback
2016-11-03 21:13:41 -07:00
Ron Buckton
cbec19afd7 Ensure transformFlags are correct before visiting a node. 2016-11-03 17:21:36 -07:00
Nathan Shively-Sanders
c9c5f49a24 Improve readability of ES next destructuring emit 2016-11-03 13:36:35 -07:00
Nathan Shively-Sanders
14f8b9990f Update objectRestAssignment test
Missed previously, just got the baselines
2016-11-03 13:33:16 -07:00
Anders Hejlsberg
702efd559b Merge pull request #12026 from Microsoft/keyofAndConstraints
Fix 'keyof' for constrained type parameters
2016-11-03 11:34:08 -07:00
Anders Hejlsberg
48f2b78125 Merge branch 'master' into keyofAndConstraints 2016-11-03 11:21:13 -07:00
Andy
9705791309 Merge pull request #12021 from Microsoft/tslint_version
Lock tslint version to 4.0.0-dev.0, because 4.0.0-dev.1 complains about unnecessary semicolons following properties
2016-11-03 11:07:25 -07:00
Anders Hejlsberg
6a5de5d00e Fix linting errors 2016-11-03 10:55:58 -07:00
Nathan Shively-Sanders
7ed52044d1 Update objectRestAssignment test and baselines 2016-11-03 10:54:07 -07:00
Nathan Shively-Sanders
7ff8876096 Merge branch 'object-spread' into object-rest-syntax 2016-11-03 10:12:45 -07:00
Anders Hejlsberg
d9b0b637e3 Accept new baselines 2016-11-03 10:01:53 -07:00
Anders Hejlsberg
4019265fe1 Update tests 2016-11-03 10:01:42 -07:00
Anders Hejlsberg
83abd048b5 Correct assignability for keyof types and type parameters 2016-11-03 10:01:27 -07:00
Nathan Shively-Sanders
7a2c7ad374 Spread handles index signatures from singleton spreads
I broke it when simplifying the logic earlier.
2016-11-03 09:41:31 -07:00
Nathan Shively-Sanders
a077fd104a Remove spread type tests from spread tests 2016-11-03 09:39:58 -07:00
Andy Hanson
e8c3d62d99 Lock tslint version to 4.0.0-dev.0, because 4.0.0-dev.1 complains about unnecessary semicolons following properties 2016-11-03 08:14:40 -07:00
Nathan Shively-Sanders
a6320203be Fix lint 2016-11-02 16:31:04 -07:00
Nathan Shively-Sanders
334820c357 Remove spread types, leaving spread syntax/emit
Spreads are still typed, but cannot be created from a non-object type.
Tests still need to be updated.
2016-11-02 16:26:34 -07:00
Nathan Shively-Sanders
9d4ddb68c7 Update baselines 2016-11-02 14:57:18 -07:00
Nathan Shively-Sanders
ac20b46f4f Add rest tests 2016-11-02 14:56:58 -07:00
Nathan Shively-Sanders
e3a08ed663 Downlevel emit of rest elements 2016-11-02 14:56:01 -07:00
Nathan Shively-Sanders
a7c18367ca Parse, bind and check rest elements 2016-11-02 14:55:24 -07:00
Vladimir Matveev
ab75ea75d3 module resolution: prefer locally defined ambient modules, reuse resolutions to ambient modules from the old program (#11999)
module resolution: prefer locally defined ambient modules, reuse resolutions to ambient modules from the old program
2016-11-02 14:41:26 -07:00
Nathan Shively-Sanders
f65dd2101c Test index [access] types inside spread types 2016-11-02 11:37:52 -07:00
Nathan Shively-Sanders
f2d739ffcf Spread types handle nested index [access] types
Nested index [access] types are treated as assignable to themselves only,
just like type parameters.
2016-11-02 11:36:25 -07:00
Sheetal Nandi
13e8f7fada Mark property referenced in the destructuring as referenced
Fixes #11324
2016-11-02 11:08:34 -07:00
Sheetal Nandi
116c87819a Test case for property used in destructuring variable declaration 2016-11-02 11:07:33 -07:00
Nathan Shively-Sanders
2ae6ecc1a5 Merge branch 'master' into object-spread 2016-11-02 10:57:20 -07:00
Anders Hejlsberg
7b34b612be Merge pull request #11929 from Microsoft/keyoftypes
Static types for dynamically named properties
2016-11-02 09:36:54 -07:00
Anders Hejlsberg
4bbe29ab73 Adding tests 2016-11-02 09:13:45 -07:00
Anders Hejlsberg
70fc25a45a Minor fixes 2016-11-02 09:02:05 -07:00
Mohamed Hegazy
6b94bae437 Fix #11396: Make error message referene Promise explicitly (#11982)
* Simplify the checking for async function return type

* Fix https://github.com/Microsoft/TypeScript/issues/11396: Make error message referene `Promise` explicitly
2016-11-01 17:03:56 -07:00