206 Commits

Author SHA1 Message Date
Sheetal Nandi
e30a66d22f Add utitlity for stringContains 2017-10-10 17:16:39 -07:00
Andy
e2141ad469 Mark some arrays as readonly (#17725)
* Mark some arrays as readonly

* Avoid unnecessary allocations and style changes

* Fix lint
2017-08-24 09:55:01 -07:00
Andy
7409648416 Remove unused UseTypeAliasValue flag (#17779) 2017-08-15 10:24:15 -07:00
Yui
39e0cc61a7 Fix 16628: "undefined" exception when name of binding element in binding pattern is empty (#17132)
* Handle the case where binding pattern name element is empty

* Update tests and baselines

* Feedback from PR

* Handle empty binding patterns more generally in emitter

* Dont simply handling fo empty binding patterns and stay spec compliant

* PR feedback
2017-08-09 13:47:44 -07:00
Andy
eadd084c82 Add 'name' property to Identifier (#17329)
* Add 'name' property to Identifier

* Rename to unescapedText

* Rename 'id.text' to 'id.escapedText'

* Rename 'id.unescapedText' to 'id.text'

* Make escapeIdentifier and unescapeIdentifier do nothing
2017-07-25 13:16:34 -07:00
Andy
194c2bc2ca Make NodeArray readonly (#17213)
* Make NodeArray readonly

* Fix bug: use emptyArray instead of undefined

* Fix bug: Don't expose MutableNodeArray

* Undo trailing whitespace changes
2017-07-18 10:38:21 -07:00
Nathan Shively-Sanders
433a06d599 Add isOptionalUninitializedParameterProperty
Improves declaration emit and code readability
2017-06-13 11:49:58 -07:00
Nathan Shively-Sanders
2a921d4b33 Use checker for decl emit:optional parameter props
Optional parameter properties create a property with a type that unions
with undefined when strictNullChecks is on. This needs to be reflected
in the generated declaration.
2017-06-13 11:31:51 -07:00
Andy
0d36d0e39f Support completions for qualified names in JSDoc (#16380)
* Support completions for qualified names in JSDoc

* Fix typo
2017-06-08 17:21:36 -07:00
Nathan Shively-Sanders
bc914c02e6 Merge pull request #15932 from Microsoft/decl-emit-class-expr-as-type-literal
Declaration-emit class expressions as type literals
2017-05-22 15:46:38 -07:00
Nathan Shively-Sanders
860e8e88c8 Add error for class exprs w/private properties 2017-05-22 14:49:35 -07:00
Nathan Shively-Sanders
a0fa8ae6c4 Address most PR comments
I am still working on the error for class expressions that extend from a
non-exported base.
2017-05-22 10:18:31 -07:00
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