Commit Graph
718 Commits
Author SHA1 Message Date
AndyandGitHub 8518343dc8 Add isStringLiteralLike helper (#21953) 2018-02-14 13:25:04 -08:00
Adrian LeonhardandMohamed Hegazy 6ab5d97a5d Changed "Duplicate Identifier" to "enum cannot be merged..." (#18579)
* Changed "Duplicate Identifier" to "enum can only be merged..."
when either declaration of the identifier is an enum.

Partial (?) fix for #529

Not sure if the new test is necessary, all the cases seem to have been covered by others tests.

* picked a nit
2018-02-12 13:38:08 -08:00
Anders Hejlsberg d608941480 Implement type inference in conditional types 2018-01-25 12:25:00 -08:00
Anders Hejlsberg 4ec6fdd96f Merge branch 'master' into conditionalTypes
# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/types.ts
#	tests/baselines/reference/api/tsserverlibrary.d.ts
#	tests/baselines/reference/api/typescript.d.ts
2018-01-17 13:12:36 -08:00
Anders Hejlsberg 5094f7677c Remove 'T extends U' type constructor 2018-01-15 08:11:05 -08:00
Wesley WighamandGitHub 64305edbce Skip outer expressions when checking for super keyword in binder (#20164)
* Skip outter expressions when checking for super keyword in binder

* use TransformFlags to optimize and correct super call transforms

* Lint
2018-01-12 18:24:02 -08:00
AndyandGitHub 8bce69e6bd Add refactoring to convert CommonJS module to ES6 module (#19916)
* Add refactoring to convert CommonJS module to ES6 module

* Code review

* includeGlobals -> excludeGlobals

* Improve handling of `module.exports = require("...")`

* Allow NoSubstitutionTemplateLiteral as argument to createLiteral
2018-01-09 13:15:47 -08:00
Wenlu WangandMohamed Hegazy 06c9a28b36 fix narrowType check with template literals (#21024) 2018-01-08 13:06:58 -08:00
AndyandGitHub fc18f08e63 Remove 'indexOf' helper, use 'arr.indexOf()' (#20194) 2018-01-08 10:39:52 -08:00
AndyandGitHub 6f2ba15446 Start linting for double spaces (#20820)
* Start linting for double spaces

* Code review

* Fix cases that were excluded by countDoubleSpaces

* Remove extraneous closing parenthesis
2018-01-08 08:52:13 -08:00
Anders Hejlsberg abc8110e9b Merge branch 'master' into conditionalTypes
# Conflicts:
#	src/compiler/checker.ts
2018-01-03 10:56:45 -08:00
Anders Hejlsberg ec2bdfdb8b Add 'T extends U' type operator 2017-12-12 09:52:14 -08:00
Anders Hejlsberg 57ca7680c9 Initial implementation of conditional type operator 2017-12-05 14:18:11 -08:00
IdeaHunter 9c3c2adfb0 Add initial support for 'in' typeguarding 2017-12-06 00:02:36 +03:00
Nathan Shively-Sanders 7208204877 Don't mutate symbol flags after creation 2017-11-30 12:33:34 -08:00
Nathan Shively-Sanders 665c2ecf91 Add SymbolFlag for containers of JS special decls
And update some doc comments
2017-11-30 10:27:38 -08:00
Nathan Shively-Sanders e441dd0005 Binder:clean up bindPropertyAssignment and friends 2017-11-28 14:29:39 -08:00
Nathan Shively-Sanders 74faa3d738 JS static properties:fix multi-file references+merging 2017-11-28 13:46:14 -08:00
Nathan Shively-Sanders 4199038652 Fix type-annotation declaration in JS files
Declaring values didn't work before.
2017-11-27 15:19:07 -08:00
Nathan Shively-Sanders 9b8b750434 Always put assignments in locals.
This means that Javascript property assignments always create a
namespace, never statics on a class. The ES5->ES6 class refactoring
still needs to be updated.
2017-11-27 11:11:48 -08:00
Nathan Shively-Sanders bee7d06761 Binder-based prop-assignment decls: messy version 2017-11-22 13:52:45 -08:00
Nathan Shively-Sanders d4f6c8cc09 Merge branch 'js-ctor-props-type-annotation-as-declaration' into jsdoc-values-as-namespaces 2017-11-21 15:06:01 -08:00
Nathan Shively-Sanders 2f0e581018 JS Property assignments create namespaces (hacky)
This version isn't done yet and I think it still causes failures in the
test suite.
2017-11-21 15:05:20 -08:00
Nathan Shively-Sanders 082802e7a8 JS:Treat type-annotated uninitialised vars as declarations
Currently only applies to property accesses, but maybe should apply to
everything.
2017-11-21 13:17:32 -08:00
Anders Hejlsberg 8c4c529d8e Merge branch 'master' into strictPropertyInitialization 2017-11-17 14:30:23 -08:00
Anders Hejlsberg 041d04577e Revise return control flow graph construction logic 2017-11-17 09:05:46 -08:00
AndyandGitHub 74a44e09a7 Support semantic classification of alias (#20012) 2017-11-17 08:04:51 -08:00
Anders Hejlsberg f1762a04ea Attach return control flow graph to contructor declaration nodes 2017-11-16 10:35:14 -08:00
Anders HejlsbergandGitHub b6f96052d8 Merge pull request #19976 from Microsoft/optimizeParser
Optimize parsing
2017-11-16 10:19:10 -08:00
Ron Buckton 804c7d3690 Merge branch 'master' into dynamicNames 2017-11-13 13:24:20 -08:00
Anders Hejlsberg ddf0df9cbb Introduce TokenFlags enum 2017-11-12 09:11:09 -08:00
AndyandGitHub 5ffcc42169 Simplify setting constEnumOnlyModule (#19735) 2017-11-10 09:34:20 -08:00
AndyandGitHub 90ae9ffe6e If there is an export default x; alias declaration, disallow other default exports (#19872) 2017-11-09 12:21:37 -08:00
Ron Buckton ee36e6a2ff Merge branch 'master' into dynamicNames 2017-11-06 17:54:48 -08:00
Wesley WighamandGitHub 4f48bf80fe Revised emit for computed property names, including with decorators (#19430)
* Revised emit for computed property names

* Fix downlevel name generation scopes

* Accept slightly more conservative baseline

* First feedback pass

* Reduce number of nonrequired variable declarations and assignments

* Remove side-effect-free identifier references

* skip partially emitted expressions

* Comments, move starsOnNewLine to emitNode

* Put expressions on newlines when inlined in class expressions for consistency

* Update new ref

* Fix typo in comment
2017-11-06 12:51:34 -08:00
Ron Buckton 33e09f9a9d Merge branch 'master' into dynamicNames 2017-11-06 12:05:25 -08:00
AndyandGitHub 0a7b7e07ee Apply 'variable-name' tslint rule (#19743) 2017-11-06 09:23:47 -08:00
Ron Buckton 208dfa6b01 Merge branch 'master' into dynamicNames 2017-11-03 22:10:28 -07:00
AndyandGitHub cc2a2a79b5 Use NodeFlags to detect nodes in ambient contexts instead of climbing ancestors (#17831)
* Use NodeFlags to detect nodes in ambient contexts instead of climbing ancestors

* Set context flags on tokens

* Remove 'isDeclarationFile' parameter to 'initializeState' and move to 'parseSourceFileWorker'

* Changes based on code review

* Update API baselines
2017-11-03 08:08:48 -07:00
uniqueiniquity 3ebb2e8a34 Merge branch 'master' into jsxFragment 2017-10-31 10:53:57 -07:00
Ron Buckton 26ca98c820 Merge branch 'master' into dynamicNames 2017-10-30 18:02:53 -07:00
Mohamed HegazyandGitHub 6c71ca84e7 Add utility function to check for strict option flags (#19427)
* Add utility function to check for strict option flags
- Correctelly check for noImplicitAny in checker
- Correctelly check for noImplicitAny in installTypesForPackage refactor

* Respond to code review comments

* Accept baselines

* Revert "Accept baselines"

This reverts commit cf4ef62830.

* Move type alias to core
2017-10-30 13:05:54 -07:00
Ron Buckton 51929acb89 Merge branch 'master' into dynamicNames 2017-10-21 00:36:52 -07:00
uniqueiniquity abb3f58db2 Add support for JSX fragment syntax 2017-10-17 09:38:09 -07:00
Wesley WighamandGitHub 611e0f7b4a Do not rely on parent pointers in the binder (#19083) 2017-10-10 15:37:05 -07:00
AndyandGitHub 3eeb54861d Fix invalid cast (#18821) 2017-10-10 10:53:43 -07:00
Ron Buckton dc607c29b4 Fix 'this' capturing for dynamic import 2017-10-09 17:15:13 -07:00
AndyandGitHub 8a55baf9a3 In @typedef tag, handle property with no type (#19013) 2017-10-09 09:58:02 -07:00
AndyandGitHub 71f8852124 Have getNameOfDeclaration return x for export default x. (#18616) 2017-10-06 14:29:45 -07:00
Ron Buckton fea6a87965 General tidying up and comments. 2017-10-04 20:39:02 -07:00