194 Commits

Author SHA1 Message Date
Anders Hejlsberg
947abf5d6b Merge branch 'master' into literalEnumTypes
# Conflicts:
#	src/compiler/checker.ts
#	src/compiler/diagnosticMessages.json
#	src/compiler/types.ts
#	src/compiler/utilities.ts
#	src/services/completions.ts
2017-05-17 11:59:12 -07:00
Andy Hanson
0ff187c8ac Remove 'isDeclarationFile()' function, use '.isDeclarationFile' 2017-05-17 08:12:23 -07:00
Nathan Shively-Sanders
1225c4e0d9 Fix lint 2017-05-10 11:51:07 -07:00
Nathan Shively-Sanders
4b4cff5684 Correctly emit expression in extends in namespace
Shouldn't have a declare for the emitted temp
2017-05-10 11:45:01 -07:00
Nathan Shively-Sanders
3768daeeca Merge pull request #15594 from Microsoft/get-name-of-declaration-wrapper
Get name of declaration uniformly, even for JS-style assignment declarations.
2017-05-10 08:08:07 -07:00
Mohamed Hegazy
0349caa5cf fix typo 2017-05-09 13:54:35 -07:00
Mohamed Hegazy
a2dec0d03d Fix #15062: report errors for parameter properties in private constructors 2017-05-09 12:03:08 -07:00
Nathan Shively-Sanders
0080c5fd66 Merge branch 'master' into get-name-of-declaration-wrapper
This PR included a fix that I already checked in this morning.
2017-05-08 15:39:57 -07:00
Nathan Shively-Sanders
efe502e609 Address PR comments 2017-05-04 17:04:37 -07:00
Nathan Shively-Sanders
d35f6c3581 getNameOfDeclaration uniformly, including JS decls
JS-style assignment declarations have a name, but it's not stored on the
name property of the BinaryExpression. This commit adds
`getNameOfDeclaration` to uniformly get the name of a declaration.

It also reworks the declaration of `Declaration` so that accessing
`name` is an error unless the type does *not* include
BinaryExpression.
2017-05-04 16:12:54 -07:00
Nathan Shively-Sanders
f61ec7fb60 Declare synthetic var for class extends expression
Classes that extend expressions will get a synthetic var declaration for
the expression. This is required for classes that extend an expression
that return an intersection type.
2017-05-02 13:36:01 -07:00
Anders Hejlsberg
640e8f5255 Fix declaration emit for string valued enum members 2017-05-01 07:12:27 -07:00
Ryan Cavanaugh
e3bb5d3f28 Update linting to avoid typechecking for booleanTriviaRule 2017-04-04 22:34:51 -07:00
Andy Hanson
3bc125463b Add more missing semicolons 2017-03-03 07:00:52 -08:00
Nathan Shively-Sanders
1296f240c6 Merge pull request #14074 from Microsoft/error-on-decl-of-extends-intersection
Error when emitting the declaration for an exported class that extends an intersection
2017-02-15 13:43:51 -08:00
Ron Buckton
23216f9ba1 Merge branch 'master' into genericDefaults 2017-02-14 19:19:18 -08:00
Nathan Shively-Sanders
c2b2c78c4a Make 'extends' error message uniform.
Refer to "'extends' clause" instead of "Extends clause".
2017-02-14 15:04:31 -08:00
Nathan Shively-Sanders
d1a972fcdd Address PR comment 2017-02-14 14:13:12 -08:00
Nathan Shively-Sanders
cd272e8244 Error on emit declaration of extends class w/o symbol
Error when emitting an extends clause for a type that has no symbol.
This error only occurs on exported classes.
This prevents the emitter from producing types that extend from
intersections, which are not parseable right now.
2017-02-14 12:42:32 -08:00
Nathan Shively-Sanders
46d9f37020 Merge pull request #12033 from Microsoft/add-undefined-to-default-valued-parameters
Add undefined to default-initialised parameters
2017-02-13 13:30:46 -08:00
Nathan Shively-Sanders
c2cd4f66e7 Address PR comments and fix lint 2017-02-13 13:21:12 -08:00
Ron Buckton
6ffcbf5b9c Merge branch 'master' into genericDefaults 2017-02-03 14:13:16 -08:00
Nathan Shively-Sanders
6f7c984c42 Address PR comments
1. Add undefined only when an initialized parameter is required (not
optional).
2. Create isRequiredInitializedParameter helper function
3. Call this function only once from declarationEmitter
2017-02-01 09:41:44 -08:00
Ron Buckton
b58ef9e932 Merge branch 'master' into genericDefaults 2017-01-30 14:32:00 -08:00
Ron Buckton
028e4e2b13 Extract printer from emitter for reusability. 2017-01-29 11:25:39 -08:00
Nathan Shively-Sanders
e96b17b4f1 Merge branch 'master' into add-undefined-to-default-valued-parameters 2017-01-25 16:03:49 -08:00
Andy Hanson
a32914f687 Combine forEachExpectedEmitFile and forEachEmittedFile 2017-01-23 11:14:29 -08:00
Ron Buckton
76ba6a7f6a Merge branch 'master' into genericDefaults 2017-01-20 20:37:35 -08:00
Andy Hanson
30ccc7a5d0 Merge branch 'master' into map5 2017-01-17 10:42:27 -08:00
Ron Buckton
061175ef9f Emit 'object' type in declaration emitter 2017-01-15 16:26:17 -08:00
Ron Buckton
3d3dae089f Adds support for type parameter defaults 2017-01-13 22:53:02 -08:00
Nathan Shively-Sanders
156d5a9043 Add | undefined to all optional properties too
in declarationEmitter.ts
2017-01-05 11:15:01 -08:00
Andy Hanson
932eaa3f90 Rename and consolidate map iteration helpers 2016-12-28 09:16:38 -08:00
Nathan Shively-Sanders
cee708df89 Remove undefined when checking patterns in function declarations 2016-12-21 10:50:38 -08:00
Nathan Shively-Sanders
604631881c Add | undefined in .d.ts for initialised params 2016-12-16 13:38:29 -08:00
Nathan Shively-Sanders
bb6f3ad29a Add parameter initialisers to control flow
Also a little code to emit them in declarations, but this doesn't work
yet.
2016-12-14 08:48:39 -08:00
Andy Hanson
6b1cc8972d Use native maps when they're available 2016-12-08 06:40:31 -08:00
Sheetal Nandi
7d049c2742 Write property name of destructuring pattern explicitly
There wont be any symbol for the property name but we already know it is a property name
Fixes #12166
2016-12-06 11:42:44 -08:00
Sheetal Nandi
adf9b26f50 Handle parameter type error for index signature in declaration emit
Fixes #12572
2016-11-30 16:28:26 -08:00
Nathan Shively-Sanders
409253145e Merge pull request #12335 from Microsoft/getJSDoc-cleanup
getJSDocs cleanup
2016-11-21 11:30:27 -08:00
Sheetal Nandi
aa556502f3 Handle when type alias's type parameter extends type that wont get emitted in .d.ts
Fixes #12326
2016-11-18 14:02:57 -08:00
Sheetal Nandi
cbde25f229 Handle the scenario when heritage clause of interface is not entity name expression
Fixes #12291
2016-11-18 13:11:33 -08:00
Nathan Shively-Sanders
eaf2f6ce69 Merge branch 'master' into getJSDoc-cleanup 2016-11-16 15:52:01 -08:00
Nathan Shively-Sanders
b8082caa8e Clean up jsdoc in utilities
Fix functions that were unused (getJsDocComments), redundant (append) or badly named
(getJSDocCommentsFromText)
2016-11-11 15:58:52 -08:00
Anders Hejlsberg
cd185f2cf6 Add declaration emit support 2016-11-10 15:20:29 -08:00
Anders Hejlsberg
e7cfbfe185 Support parametric property access expressions + some renaming 2016-10-26 13:39:12 -07:00
Anders Hejlsberg
c21592ede1 Initial implementation of 'T[K]' property access types 2016-10-25 14:32:20 -07:00
Anders Hejlsberg
ad88109420 Initial implementation of 'keyof T' type operator 2016-10-24 15:24:26 -07:00
Andy Hanson
5e7e5421fa Add noop, notImplemented, and notYetImplemented helpers 2016-10-19 14:21:48 -07:00
Andy Hanson
7685e6af15 Forbid unused locals/parameters in compiler 2016-10-18 14:00:52 -07:00