Commit graph

337 commits

Author SHA1 Message Date
Mohamed Hegazy 84fc29f900 Fix lint failures detected by tslint@4.4.2 2017-02-09 12:46:09 -08:00
Vladimir Matveev 915ffab8cc disable fs watcher for UNC paths on Windows (#13937) 2017-02-07 14:47:07 -08:00
Andy Hanson 7baeb9726a Merge branch 'master' into no_dom 2017-01-17 14:35:33 -08:00
Andy Hanson b40613c4d7 Stop using "dom" types 2017-01-12 14:05:18 -08:00
Andy Hanson 757af2e1d6 Fix tsconfig inheritance in gulpfile -- must do it manually 2017-01-12 13:11:26 -08:00
Andy Hanson 145f0b2f18 Add createMultiMap to replace multiMapAdd and multiMapRemove 2016-12-28 09:33:43 -08:00
Andy Hanson 9e33585a80 Merge branch 'master' into map5 2016-12-27 12:56:05 -08:00
Kagami Sascha Rosylight 27a60e4580 fix linting errors 2016-12-18 15:44:54 +09:00
Andy Hanson 6b1cc8972d Use native maps when they're available 2016-12-08 06:40:31 -08:00
Vladimir Matveev 9e3d6efb19 reduce set of files being watched, increase polling interval (#12054) (#12092) 2016-11-07 21:13:11 -08:00
Vladimir Matveev 0173a3fa79 return empty file watcher in case if target directory does not exist (#12091)
* return empty file watcher in case if target directory does not exist

* linter
2016-11-07 15:48:46 -08:00
Andy Hanson 12f6dcefa1 Revert "Merge pull request #11354 from Microsoft/map4"
This reverts commit adfdae0dc4, reversing
changes made to aad663cebf.
2016-10-27 15:50:21 -07:00
Andy Hanson bcc0807198 Respond to PR comments 2016-10-27 13:14:56 -07:00
Andy Hanson c958c47ef5 Merge branch 'master' into map4 2016-10-26 11:05:51 -07:00
Zhengbo Li 3f234f2e7f Move setTimeout to sys (#11746) 2016-10-20 11:30:05 -07:00
Andy Hanson a11838215c Merge branch 'master' into map4 2016-10-19 13:16:55 -07:00
Andy Hanson f11dbc1ad1 Respond to PR feedback 2016-10-19 06:26:50 -07:00
Andy Hanson 7685e6af15 Forbid unused locals/parameters in compiler 2016-10-18 14:00:52 -07:00
Andy Hanson 7292f9f67e Merge branch 'master' into map4 2016-10-17 06:49:53 -07:00
Zhengbo Li a6443e3e5a Avoid watching non-existing directories and fix null-exception (#11601)
* Avoid watching non-existing directories and fix null-exception

* Add test

* Move the fix to sys to cover tsc -w also
2016-10-13 15:39:09 -07:00
Andy Hanson 3b7a1a8e22 Remove more uses of 'get' 2016-10-06 13:29:18 -07:00
Andy Hanson aadcbcc083 Use native maps when they're available 2016-10-06 13:29:18 -07:00
Vladimir Matveev 8dabe33b32 fix linter (#11366) 2016-10-04 14:00:45 -07:00
Vladimir Matveev 5cdbe773c6 guard against cases when current file name is already in uppercase 2016-10-03 14:42:06 -07:00
Vladimir Matveev 0c000e831d Merge remote-tracking branch 'tf/bug-mac-osx-case-sensitive' into vladima/fs-case-sensitivity 2016-10-03 14:16:25 -07:00
Vladimir Matveev 833a46c091 merge with origin/master 2016-09-27 10:22:41 -07:00
Vladimir Matveev 2a206b3dd7 add check if expected directory path is non-empty string 2016-09-21 00:02:20 -07:00
Zhengbo Li 3c20df5e93 Create folders for sys.writeFile if folder doesn't exist (#10848)
* Create folders for sys.writeFile

* Use project root path for emit output file name

* Normalize project file path for external projects

* Patch writeFile for all sys implementations

* Use the original file for single inferred project case

* recursive create directory for all sys implementations
2016-09-13 16:20:42 -07:00
Torben Fitschen 85d589431c Added detection for case sensitive file systems 2016-09-09 11:07:23 +02:00
Kanchalai Tanglertsampan e1be0bcd4c Merge branch 'master' into mergeMaster_09/01 2016-09-06 11:26:21 -07:00
Andy Hanson 74df44480b Add multiMapRemove helper 2016-09-02 07:19:10 -07:00
Andy Hanson 13b63c5838 Merge branch 'master' into multi_map_add 2016-09-02 06:10:04 -07:00
Kanchalai Tanglertsampan b5f4c074d6 Merge branch 'master' into mergeMaster_09/01 2016-09-01 16:19:44 -07:00
Andy Hanson d7b6cc89b5 Respond to PR comments 2016-09-01 12:40:31 -07:00
Yui a370908421 [Transforms] Merge master 08/09 (#10263)
* Improve error message

* Remove `SupportedExpressionWithTypeArguments` type; just check that the expression of each `ExpressionWithTypeArguments` is an `EntityNameExpression`.

* Fix bug

* Fix #10083 - allowSyntheticDefaultImports alters getExternalModuleMember (#10096)

* Use recursion, and fix error for undefined node

* Rename function

* Fix lint error

* Narrowing type parameter intersects w/narrowed types

This makes sure that a union type that includes a type parameter is
still usable as the actual type that the type guard narrows to.

* Don't allow ".d.ts" extension in an import either.

* Add a helper function `getOrUpdateProperty` to prevent unprotected access to Maps.

* Limit type guards as assertions to incomplete types in loops

* Accept new baselines

* Fix linting error

* Allow JS multiple declarations of ctor properties

When a property is declared in the constructor and on the prototype of
an ES6 class, the property's symbol is discarded in favour of the
method's symbol. That because the usual use for this pattern is to bind
an instance function: `this.m = this.m.bind(this)`. In this case the
type you want really is the method's type.

* Use {} type facts for unconstrained type params

Previously it was using TypeFacts.All. But the constraint of an
unconstrained type parameter is actually {}.

* Fix newline lint

* Test that declares conflicting method first

* [Release-2.0] Fix 9662: Visual Studio 2015 with TS2.0 gives incorrect @types path resolution errors (#9867)

* Change the shape of the shim layer to support getAutomaticTypeDirectives

* Change the key for looking up automatic type-directives

* Update baselines from change look-up name of type-directives

* Add @currentDirectory into the test

* Update baselines

* Fix linting error

* Address PR: fix spelling mistake

* Instead of return path of the type directive names just return type directive names

* Remove unused reference files: these tests produce erros so they will not produce these files (#9233)

* Add string-literal completion test for jsdoc

* Support other (new) literal types in jsdoc

* Don't allow properties inherited from Object to be automatically included in TSX attributes

* Add new test baseline and delete else in binder

The extra `else` caused a ton of test failures!

* Fix lint

* Port PR #10016 to Master (#10100)

* Treat namespaceExportDeclaration as declaration

* Update baselines

* wip - add tests

* Add tests

* Show "export namespace" for quick-info

* Fix more lint

* Try using runtests-parallel for CI (#9970)

* Try using runtests-parallel for CI

* Put worker count setting into .travis.yml

* Reduce worker count to 4 - 8 wasnt much different from 4-6 but had contention issues causing timeouts

* Fix lssl task (#9967)

* Surface noErrorTruncation option

* Stricter check for discriminant properties in type guards

* Add tests

* Emit more efficient/concise "empty" ES6 ctor

When there are property assignments in a the class body of an inheriting
class, tsc current emit the following compilation:

```ts
class Foo extends Bar {
  public foo = 1;
}
```

```js
class Foo extends Bar {
  constructor(…args) {
    super(…args);
    this.foo = 1;
  }
}
```

This introduces an unneeded local variable and might force a reification
of the `arguments` object (or otherwise reify the arguments into an
array).

This is particularly bad when that output is fed into another transpiler
like Babel. In Babel, you get something like this today:


```js
var Foo = (function (_Bar) {
  _inherits(Foo, _Bar);

  function Foo() {
    _classCallCheck(this, Foo);

    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _Bar.call.apply(_Bar, [this].concat(args));
    this.foo = 1;
  }

  return Foo;
})(Bar);
```

This causes a lot of needless work/allocations and some very strange
code (`.call.apply` o_0).

Admittedly, this is not strictly tsc’s problem; it could have done a
deeper analysis of the code and optimized out the extra dance. However,
tsc could also have emitted this simpler, more concise and semantically
equivalent code in the first place:


```js
class Foo extends Bar {
  constructor() {
    super(…arguments);
    this.foo = 1;
  }
}
```

Which compiles into the following in Babel:

```js
var Foo = (function (_Bar) {
  _inherits(Foo, _Bar);

  function Foo() {
    _classCallCheck(this, Foo);

    _Bar.apply(this, arguments);
    this.foo = 1;
  }

  return Foo;
})(Bar);
```

Which is well-optimized (today) in most engines and much less confusing
to read.

As far as I can tell, the proposed compilation has exactly the same
semantics as before.

Fixes #10175

* Fix instanceof operator narrowing issues

* Accept new baselines

* Add regression test

* Improve naming and documentation from PR

* Update comment

* Add more tests

* Accept new baselines

* Reduce worker count to 3 (#10210)

Since we saw a starvation issue on one of @sandersn's PRs.

* Speed up fourslash tests

* Duh

* Make baselines faster by not writing out unneeded files

* Fix non-strict-compliant test

* Fix 10076: Fix Tuple Destructing with "this" (#10208)

* Call checkExpression eventhough there is no appropriate type from destructuring of array

* Add tests and baselines

* use transpileModule

* Remove use strict

* Improve instanceof for structurally identical types

* Introduce isTypeInstanceOf function

* Add test

* Accept new baselines

* Fix loop over array to use for-of instead of for-in

* Use correct this in tuple type parameter constraints

Instantiate this in tuple types used as type parameter constraints

* Add explanatory comment to resolveTupleTypeMembers

* Ignore null, undefined, void when checking for discriminant property

* Add regression test

* Delay tuple type constraint resolution

Create a new tuple that stores the this-type.

* Always use thisType when generating tuple id

* Optimize format of type list id strings used in maps

* wip - fix error

* Make ReadonlyArray iterable.

* Allow OSX to fail while we investigate (#10255)

The random test timeouts are an issue.

* Fix error from using merging master

* avoid using the global name

* Fix single-quote lint

* Update baselines

* Fix linting

* Optimize performance of maps

* Update API sample

* Fix processDiagnosticMessages script

* Have travis take shallow clones of the repo (#10275)

Just cloning TS on travis takes 23 seconds on linux (68 seconds on mac), hopefully having it do a shallow clone will help.

We don't rely on any tagging/artifacts from the travis servers which clone depth could impact, so this shouldn't impact anything other than build speed.

* Add folds to travis log (#10269)

* Optimize filterType to only call getUnionType if necessary

* Add shorthand types declaration for travis-fold (#10293)

* Optimize getTypeWithFacts

* Filter out nullable and primitive types in isDiscriminantProperty

* Fix typo

* Add regression tests

* Optimize core filter function to only allocate when necessary

* Address CR comments + more optimizations

* Faster path for creating union types from filterType

* Allow an @types direcotry to have a package.json which specifies `"typings": null` to disclude it from automatically included typings.

* Lint

* Collect timing information for commands running on travis (#10308)

* Simplifies performance API

* Use 'MapLike' instead of 'Map' in 'preferConstRule.ts'.

* narrow from 'any' in most situations

instanceof and user-defined typeguards narrow from 'any' unless the narrowed-to type is exactly 'Object' or 'Function'. This is a breaking change.

* Update instanceof conformance tests

* accept new baselines

* add tests

* accept new baselines

* Use lowercase names for type reference directives

* Use proper response codes in web tests

* Treat ambient shorthand declarations as explicit uses of the `any` type

* Rename 'find' functions

* Parallel linting (#10313)

* A perilous thing, a parallel lint

* Use work queue rather than scheduling work

* Dont read files for lint on main thread

* Fix style

* Fix the style fix (#10344)

* Aligned mark names with values used by ts-perf.

* Use an enum in checkClassForDuplicateDeclarations to aid readability

* Rename to Accessor

* Migrated more MapLikes to Maps

* Add ES2015 Date constructor signature that accepts another Date (#10353)

* Parameters with no assignments implicitly considered const

* Add tests

* Migrate additional MapLikes to Maps.

* Fix 10625: JSX Not validating when index signature is present  (#10352)

* Check for type of property declaration before using index signature

* Add tests and baselines

* fix linting error

* Adding more comments

* Clean up/move some Map helper functions.

* Revert some formatting changes.

* Improve ReadonlyArray<T>.concat to match Array<T>

The Array-based signature was incorrect and also out-of-date.

* Fix link to blog

* Remove old assertion about when we're allowed to use fileExists

* Set isNewIdentifierLocation to true for JavaScript files

* Update error message for conflicting type definitions

Fixes #10370

* Explain why we lower-case type reference directives

* Correctly merge bindThisPropertyAssignment

Also simply it considerably after noticing that it's *only* called for
Javascript files, so there was a lot of dead code for TS cases that
never happened.

* Fix comment

* Property handle imcomplete control flow types in nested loops

* Update due to CR suggestion

* Add regression test

* Assign and instantiate contextual this type if not present

* Fix 10289: correctly generate tsconfig.json with --lib (#10355)

* Separate generate tsconfig into its own function and implement init with --lib

# Conflicts:
#	src/compiler/tsc.ts

* Add tests and baselines; Update function name

Add unittests and baselines
Add unittests and baselines for generating tsconfig

Move unittest into harness folder

Update harness tsconfig.json

USe correct function name

* Use new MapLike interstead. Update unittest

# Conflicts:
#	src/compiler/commandLineParser.ts

* Update JakeFile

* Add tests for incorrect cases

* Address PR : remove explicity write node_modules

* JSDoc supports null, undefined and never types

* Update baselines in jsDocParsing unit tests

* Restored comments to explain spreading 'arguments' into calls to 'super'.

* Added test.

* Use the non-nullable type of the contextual type for object completions.

* Return non-JsDocComment children
... to make syntactic classification work

* Add more tests for `export = foo.bar`.

* Output test baselines to tests/baselines/local instead of root

* Move supportedTypescriptExtensionsWithDtsFirst next to supportedTypeScriptExtensions and rename

* Fix comment

* Fix RWC Runner (#10420)

* Use /// <reference types

* Don't report an errors if it comes from lib.d.ts

* Treat special property access symbol differently
... when retriving documentation

* Fix tests

* Update shim version to be 2.1 (#10424)

* Check return code paths on getters (#10102)

* Check return paths on getters

* Remove TODO comment

* Remove extraneous arguments from harness's runBaseline (#10419)

* Remove extraneous arguments from runBaseline

* Address comments from @yuit

* Remove needless call to basename

* Refactor baseliners out of compiler runner (#10440)

* CR feedback

* fix broken tests

* Pass in baselineOpts into types baselines so that RWC baselines can be written to internal folder (#10443)

* Add error message

Add error message when trying to relate primitives to the boxed/apparent
backing types.

* fix linting error

* follow advise

* remove extra code

* Add more test for 10426

* fix some errors

* routine update of dom libs

* Add test for jsdoc syntactic classification for function declaration

* Simplify implementation

* Tolerate certain errors in tsconfig.json

* Add test for configFile error tolerance

* Use TS parser to tolerate more errors in tsconfig.json

* Implement tuple types as type references to synthesized generic types

* Add comments + minor changes

* Accept new baselines

* Add .types extension

* Properly guard for undefined in getTypeReferenceArity

* Add jsdoc nullable union test case to fourslash

* Fix class/interface merging issue + lint error

* Allow "typings" in a package.json to be missing its extension (but also allow it to have an extension)

* Contextually type this in getDeclFromSig, not checkThisExpr

* Update parser comment with es7 grammar (#10459)

* Use ES7 term of ExponentiationExpression

* Update timeout for mac OS

* Address PR: add space

* allowSyntheticDefaultImports resolves to modules instead of variables

Fixes #10429 by improving the fix in #10096

* Rename getContextuallyTypedThisParameter to getContextualThisParameter

* Fix 10472: Invalid emitted code for await expression (#10483)

* Properly emit await expression with yield expression

* Add tests and update baselines

* Move parsing await expression into parse unary-expression

* Update incorrect comment

* change error message

* Fix broken build from merging with master

* Fix linting error
2016-08-26 15:51:10 -07:00
Andy Hanson d6aa65daf1 Use unordered removal where possible 2016-08-22 06:18:31 -07:00
Andy Hanson 949c517fdd Add multiMapAdd helper 2016-08-19 07:15:19 -07:00
Andy Hanson 5ad7729357 Use removeItem instead of copyListRemovingItem 2016-08-15 13:17:15 -07:00
Anders Hejlsberg 65e1293b2e Optimize performance of maps 2016-08-10 16:47:06 -07:00
Ron Buckton ed0a653515 Merge branch 'master' into transforms 2016-08-02 11:45:56 -07:00
Yui cfc20a956a [Transforms] Merging Master to Transforms on 06/21 (#9294)
* Initial support for globs in tsconfig.json

* Added caching, more tests

* Added stubs to ChakraHost interface for readDirectoryNames/readFileNames

* Fixed typos in comments

* Changed name of 'reduce' method added to FileSet

* Heavily revised implementation that relies on an updated 'readDirectory' API.

* more tests

* Minor update to shims.ts for forthcoming VS support for globs.

* Detailed comments for regular expressions and renamed some files.

* Comment cleanup

* Fixed new linter warnings

* Add upper limit for the program size, fix readDirectory for the symlink files

* Add comments

* CR feedback / Change upper limit / Add disableSizeLimit compiler option

* online and offline CR feedback

* Don't count current opened client file if it's TS file

* Speed up file searching

* Make language service optional for a project

* Fix failed tests

* Fix project updateing issue after editing config file

* Fixing linter and test errors

* Bringing back excludes error and fixing faulty test

* Fixing lint errors

* Passing regular expressions to native hosts

* Fix merging issues and multiple project scenario

* Refactoring

* add test and spit commandLineParser changes to another PR

* Fix #8523

* check the declaration and use order if both are not in module file

* Type guards using discriminant properties of string literal types

* Fix #9098: report missing function impelementation errors for merged classes and namespaces

* Narrow type in case/default sections in switch on discriminant property

* No implicit returns following exhaustive switch statements

* Narrow non-union types to ensure consistent results

* Add tests

* No Need to store dot token when parsing property access expression

* Added tests.

* Accepted baselines.

* Check tuple types when getting the type node's type.

* Accepted baselines.

* Fix #9173: clear out lib and types before creating a program in transpileModule

* Added tests.

* Accepted baselines.

* Always check type assertion types.

* Clear out unused compiler options when transpiling

* Accepted baselines.

* improve error message for extending interface

* accept baselines

* Use helper functions to simplify range tests

* Remove String, Number, and Boolean from TypeFlags.Falsy

* Add regression test

* Accept new baselines

* Allow property declarations in .js files

* Remove old test

* Do not use Object.assing in test

* Fix comment

* Refactor code to make if statements cheaper

* ignore casing when converting a source file path to relative path

* add tests & add branches for module interface

* Using baselines for transpile unittests (#9195)

* Conver to Transpile unittest to use baselines instead

* Add baselines

* Fix linting error

* use resolveEntityName to find interface

* add new tests for extends interface

* address code style

* Refactor navigation bar

* routine dom update

* Updating readDirectory for tsserverProjectSystem unit tests

* Array#map -> ts.map.

* Responding to PR feedback

* Add conditional index signature for Canvas2DContextAttributes (https://github.com/Microsoft/TypeScript/issues/9244)

* Add libcheck tests

* Add missing worker types

* Accept webworker baselines

* Classify `this` in parameter position as a keyword

* Adding more matchFiles test cases

* Use implicit boolean casts; it doesn't hurt performance

* Use getCanonicalFileName

* export interface used by other exported functions

* Fix from merging with master

* Update tests and baselines from merging with master

* Remove using dotToken as it is no longer needed

* Update baselines from removing dotToken

* Address PR: Add NodeEmitFlags to no indent when emit

* Address PR; and refactor setting NodeEmitFlags for createMemberAccessForPropertyName

* Update baselines
2016-07-11 12:41:12 -07:00
Nathan Shively-Sanders a138e6307f Avoid using this in object literals where possible 2016-07-11 11:30:22 -07:00
Nathan Shively-Sanders b543074861 Compile with --noImplicitThis
1. Add to various tsconfig.json
2. Add to Jakefile
3. Add annotations where needed.
4. Add workaround to shims.ts, which uses toplevel `this`.
2016-07-08 15:13:32 -07:00
Richard Knoll f817ffaf47 Merge branch 'master' into glob2_merged 2016-06-17 17:55:15 -07:00
Richard Knoll 95072aab82 Responding to PR feedback 2016-06-17 17:32:10 -07:00
Yui 5f91b3cf40 [Transforms] merging "master" on 06/15/2016 (#9218)
* Add upper limit for the program size, fix readDirectory for the symlink files

* Add comments

* CR feedback / Change upper limit / Add disableSizeLimit compiler option

* online and offline CR feedback

* Don't count current opened client file if it's TS file

* Speed up file searching

* Make language service optional for a project

* Fix failed tests

* Fix project updateing issue after editing config file

* Fix merging issues and multiple project scenario

* Refactoring

* add test and spit commandLineParser changes to another PR

* Fix #8523

* check the declaration and use order if both are not in module file

* Fix #9098: report missing function impelementation errors for merged classes and namespaces

* Added tests.

* Accepted baselines.

* Check tuple types when getting the type node's type.

* Accepted baselines.

* Fix #9173: clear out lib and types before creating a program in transpileModule

* Added tests.

* Accepted baselines.

* Always check type assertion types.

* Accepted baselines.

* Use helper functions to simplify range tests

* Remove String, Number, and Boolean from TypeFlags.Falsy

* Add regression test

* Accept new baselines

* Allow property declarations in .js files

* Remove old test

* Refactor code to make if statements cheaper

* Fix test failure from mergining with master
2016-06-17 16:40:26 -07:00
Richard Knoll 08ca1c0dff Merge branch 'master' into glob2_merged 2016-06-17 15:34:06 -07:00
Yui f235bf7db8 [Transforms] Merge master 06/06/2016 (#8991)
* Remove check narrowing only certain types, add test showing issues with this

* string literal case test

* Reconcile fix with CFA work

* Defaultable -> NotNarrowable to align with use

* Missed a defaultable in comments

* Add test for narrowing to unions of string literals

* Rewrite isInStringLiteral to accomodate for unterminated strings

* Refactor signatureHelp to expose helper functions

* Add support for completion in string literals

* Remove unused check

* Use const instead of let

* Fix error

* Formatting changes

* Use shorthand properties

* Add failing test for #8738

* Sort baseline reference identifier by name

* Detects assignment to internal module export clause, fixes #8738

* add SharedArrayBuffer

fix

* Factor out assignment op check

* Add test for composite assignment

* Factor out the behaviour and handles x++ and ++x

* Handles ES3 default as identifier name

* Fix missing else statement

* isNameOfExportedDeclarationInNonES6Module

* Reorder options alphabetically

* Mark diagnostics, and skipDefaultLibCheck as internal

* Allow an import of "foo.js" to be matched by a file "foo.ts"

* Improve loadModuleFromFile code

* Respond to PR comments

* Respond to more PR comments

* Fix test

* Actually merge from master

* Revert to old tryLoad implementation

* Run fixupParentReferences when parsing isolated jsDocComment

* initial revision of unit test support for project system in tsserver

* Allow wildcard ("*") patterns in ambient module declarations

* Add non-widening forms of null and undefined

* Create separate control flows for property declarations with initializers

* Add regression test

* Allow trailing commas in function parameter and argument lists

* Add tests

* Remove unused variable

* Add null check and CR feedback

* Support shorthand ambient module declarations

* Revert "Merge pull request #7235 from weswigham/narrow-all-types"

This reverts commit ef0f6c8fe4, reversing
changes made to 9f087cb62a.

* reuse the fixupParentReferences function

* Improve typing of && operator with --strictNullChecks

* Add test

* Respond to PR comments

* Respond to PR comments

* Add merging tests

* Use a function `stringify` to simplify calls to `JSON.stringify(xyz, undefined, 2)`

* Update tests

* Fix mistake

* Include indent in navigation bar protocol

Previously navbar01 test had indents when run in the browser but not when run from node. Now they run the same.

* Remove unnecessary restrictions in property access narrowing

* Fix fourslash test

* Add regression test

* Consider property declarations to be control flow containers

* Adding regression test

* Remove restriction on --target es5 and --module es6

* change type definition for Object.create

* Fix signature help

* Add "implicit any" warning for shorthand ambient modules

* Remove trailing whitespace

* Support using string values in enums for CompilerOptions in transpile methods

* Remove trailing whitespace in jakefile

* Make `jake runtests-browser` support test regexes with spaces

For example: `jake runtests-browser t="transpile .js files"` now works.

* Add another test

* factor out isJsxOrTsxExtension

* Move to a conformance test

* Revert "Revert "Merge pull request #7235 from weswigham/narrow-all-types""

This reverts commit fc3e040c51.

* Use inclusive flag, as originally done, but include almost everything

* Add additional tests

* Respond to PR comments

* Fix typo

* add tests for tsserver project system

* Fix test

* Allow case comparison to undefined and null in strict null checking mode

* Remove incorrectly added tests

* check if moduleResolution when verifying that program can be reused

* more tests for module resolution change and exclude

* Fix linting issues

* Merge JSDoc of assignments from function expressions

* Allow nested assignments in type guards

* Add tests

* Improve order of parameter's merged jsdoc

* Force LF newlines for LKG builds/non debug builds
Fixes 6630

* Create intersection types in type guards for unrelated types

* Split commentsFunction test into expr/decl

And renumber.

* Remove TODO comments

* Accept new baselines

* Add tests

* Remove comments

* Fix test helper

* Recognize relative path using in outDir property (#9025)

* Recognize relative path using in outDir property

* Add projects tests

* Add project .json files

* Update baselines

* Add comments

* Add test case

The test passes in 1.8 and fails in master.

* Return trace when exception happens

* Remove Long-Done TODO

AFAIK, the harness sources have been concatenated into `run.js` for as long as I've known. This stops executing them twice (and in turn makes debugging tests much easier, since you no longer have to debug into eval'd code).

* Allow primitive type guards with typeof on right

Previously, only type guards of the form `typeof x === 'string'` were
allowed. Now you can write `'string' === typeof x`.

* Primitive type guards are now order independent

* Fix comments in tests

* Add handleing for classes

* Add more tests for target=es5 module=es6

* addExportToArgumentListKind

* Accept baseline

* Add more tests

* wip-fixing transforms

* Adds progress indicators to the runtests-parallel build task.

* Fixed typo

* Fix comment

* Add test for out-of-range error

* Use proper method of not resolving alias

* Fix module loading error

(commandLineOptions_stringToEnum would be undefined if optionDeclarations wasn't loaded yet)

* Port 8739

* Update tests

* Update baselines

* Contextually type return statement in async function

* Remove stale files

* Undo change

* Improve perf

* Improve tests

* Fix sourcemaps for debugging tests

* Allow --sourceRoot with --inlineSources option
Fixes #8445

* this in parameter initializers resolves to class

Accept baselines now that the test passes.

* Add tests for more kinds of import/export

* Fix7334 Disallow async in functionExpression and ArrowFunction (#9062)

* Error when using async modifier in function-expression and arrow-function when target es5

* Add tests and baselines

* Resolve function-this in parameter initialisers when explicitly provided

* Allow null/undefined guard with null/undefined on left

Also add a test with baselines.

* Code review comments

* Update more diagnostic messages ES6->2015

Fix #8996 CC @mhegazy.

* Fixes an issue with runtests-parallel when global mocha is not installed.

* Update LKG

* Add tests

* fix baselines

* Recommend runtests-parallel in CONTRIBUTING

* Only inlineSourceMap when debugging through jake-browser (#9080)

* Only inlineSourceMap when debugging through jake-browser

* Address PR: fix typo in opt's property

* Manually port tests from PR 8470

* minor fix: add missing return clause

* Support using string values in enums for CompilerOptions in transpile methods

* Support using string values in enums for CompilerOptions in transpile methods

# Conflicts:
#	tests/cases/unittests/transpile.ts

* Fix test helper

* Add test for out-of-range error

* Fix module loading error

(commandLineOptions_stringToEnum would be undefined if optionDeclarations wasn't loaded yet)

* Use camel-case instead of snake-case (#9134)

* Manually add tests for PR 8988

* Allow wildcard ("*") patterns in ambient module declarations

* Respond to PR comments

* Add another test

* Improve perf

* Improve tests

* Update baseline from merging with master

* Address PR comment

* Update baseline

* Refactor how we retrieve binding-name cache in module transformer

* Temporary accept so we get a clean run-tests result
2016-06-14 11:36:57 -07:00
zhengbli e41b10bbc7 add test and spit commandLineParser changes to another PR 2016-06-10 02:06:31 -07:00
zhengbli d387050aaa Fix merging issues and multiple project scenario 2016-06-09 15:30:55 -07:00
zhengbli 94d44ad81d Merge branch 'master' of https://github.com/Microsoft/TypeScript into fixLargeProjectTry2
# Conflicts:
#	src/compiler/commandLineParser.ts
#	src/compiler/program.ts
#	src/compiler/sys.ts
#	src/compiler/types.ts
#	src/server/editorServices.ts
#	src/server/session.ts
2016-06-09 14:58:28 -07:00
zhengbli 3052913b92 add tests for tsserver project system 2016-06-07 02:14:56 -07:00
Richard Knoll 0415b95fd2 Passing regular expressions to native hosts 2016-05-31 10:11:04 -07:00
Richard Knoll aa5c51c516 Fixing lint errors 2016-05-26 10:17:43 -07:00
Richard Knoll 50f0033e61 Merge branch 'master' into glob2_merged
Conflicts:
	src/compiler/sys.ts
	src/harness/harnessLanguageService.ts
	tests/cases/unittests/cachingInServerLSHost.ts
	tests/cases/unittests/tsconfigParsing.ts
2016-05-26 10:04:54 -07:00
Richard Knoll db856431e8 Fixing linter and test errors 2016-05-25 17:07:36 -07:00
Richard Knoll 084b94c4c1 Merge branch 'master' into glob2
Conflicts:
	Jakefile.js
	src/compiler/commandLineParser.ts
	src/compiler/core.ts
	src/compiler/sys.ts
	src/harness/harness.ts
	src/server/editorServices.ts
	src/services/shims.ts
	tests/cases/unittests/cachingInServerLSHost.ts
2016-05-25 17:06:50 -07:00
Ron Buckton ee39c4e8d4 Merge branch 'master' into transforms-merge 2016-05-25 14:14:32 -07:00
Ryan Cavanaugh 2d5f38c2bc Only return dirs from getdirectories 2016-05-23 16:20:13 -07:00
Ryan Cavanaugh f4e10eb738 Automatically consume /types 2016-05-17 15:41:31 -07:00
Vladimir Matveev 2b5bbfee60 use CompilerHost.realpath to resolve actual location for symlinks 2016-05-05 13:38:09 -07:00
zhengbli a09b001c61 Add env to allow switch to non-polling if really wants to 2016-04-22 11:54:09 -07:00
zhengbli 576e5f8055 So we are back to polling. 2016-04-19 14:25:57 -07:00
Nathan Shively-Sanders f8ab1a5ca6 Merge branch 'master' into transforms 2016-04-18 13:27:33 -07:00
mihailik aa2708f510 Prefer ChakraHost when available to node and WScript 2016-04-10 12:07:47 +01:00
Ron Buckton 3507ed021c Fixes issues that were causing runtests-browser to fail 2016-04-07 16:13:28 -07:00
Mohamed Hegazy 4b5618bd60 Merge branch 'master' of https://github.com/vilic/TypeScript into vilic-master 2016-04-04 11:23:30 -07:00
Zhengbo Li 5c9ce9e8ec Merge branch 'master' of https://github.com/Microsoft/TypeScript into fixLargeProjectTry2
# Conflicts:
#	src/compiler/sys.ts
2016-03-28 13:22:07 -07:00
zhengbli ddbfb7b961 refactor 2016-03-24 15:56:13 -07:00
zhengbli d0545ffee8 Explicitly exclude . and .. for fs.readdirSync 2016-03-24 14:16:38 -07:00
zhengbli e9b514cf8a Use fileName instead of Path when dealing with file systems directly 2016-03-23 12:49:34 -07:00
Ron Buckton 02ebfa5d11 Added environment variable to force experimental transformations. 2016-03-21 11:54:10 -07:00
Ron Buckton 3c344987de Merge branch 'master' into transforms 2016-03-18 17:13:55 -07:00
zhengbli cb46f16406 Fix failed tests 2016-03-17 19:57:40 -07:00
zhengbli c8e0b00007 Make language service optional for a project 2016-03-17 15:55:53 -07:00
zhengbli 225e3b4f45 Speed up file searching 2016-03-16 23:01:24 -07:00
zhengbli a3aa0002a3 CR feedback / Change upper limit / Add disableSizeLimit compiler option 2016-03-14 14:54:18 -07:00
zhengbli b155fa847a Add comments 2016-03-11 16:18:40 -08:00
zhengbli 4d3cff1e5a Add upper limit for the program size, fix readDirectory for the symlink files 2016-03-11 15:56:36 -08:00
Ron Buckton dd2dc78dd6 Enables source maps for exceptions thrown in the compiler (when available) 2016-02-19 16:59:57 -08:00
Bill Ticehurst cc76f0f7f0 Fixed watcher for rename operations, and for allowJs in config file
(cherry picked from commit 745f32bbee)
2016-02-12 08:59:16 -08:00
Vladimir Matveev b18cbc6300 address PR feedback 2016-02-11 17:29:01 -08:00
Vladimir Matveev 354e650341 fix 'fileExists' check by using stat directly 2016-02-11 16:59:54 -08:00
Josh Soref 284b26f49f spelling fixes for src/compiler
* after
* aggressive
* appear
* asterisks
* candidate
* conflict
* directory
* dollar
* ellipsis
* exports
* failures
* folder
* followed
* highlight
* inferred
* location
* occurred
* output
* propagated
* push
* rather
* remaining
* search
* stabilized
* substitution
* successful
* even though
* will
* with
2016-02-11 16:56:45 +00:00
vilicvane 0282c0463d Revert hash object caching 2016-02-10 08:50:22 +08:00
vilicvane acf965a20e Refine implementation 2016-02-10 08:47:52 +08:00
vilicvane 63c690813f Create createHash and getModifiedTime under sys, and refactor implementation into compiler host 2016-02-09 22:23:43 +08:00
vilicvane c7e80e19f0 Avoid writing files that are not changed while compiling incrementally. 2016-02-06 16:51:25 +08:00
Tim Viiding-Spader 8e472db66f Delete mention of nonexistent watcherPath param
It doesn't exist now.

It didn't exist in the commit that first mentioned it.
2016-02-02 15:44:47 -06:00
zhengbli c244306514 address CR feedback: use typeof check instead of checking undefined and null value 2016-01-15 16:55:25 -08:00
zhengbli c2f453b8fb Fix the getCanonicalFileName in sys.ts and also check null value in file watcher call back 2016-01-15 14:58:04 -08:00
Zhengbo Li dbfe862dbd not casting relative filenames in 'tsc watch' to Path 2016-01-14 00:34:43 -08:00
Zhengbo Li 067573b0c3 cr feedback: simplify the removeFile function 2016-01-13 14:03:18 -08:00
Zhengbo Li 02531af991 Update the watchedFileSet to use Path instead of string for file names 2016-01-13 13:18:28 -08:00
Zhengbo Li d22626f32d Fix lint issue 2016-01-12 00:17:38 -08:00
zhengbli 114d2bd66d Separate directory watching and file watching again to reduce logic complexity, because reference counting is a lot easier in this case 2016-01-11 11:35:46 -08:00
Zhengbo Li 697644c583 spell our dir to directory 2016-01-07 22:48:17 -08:00
Ron Buckton c1205ebdfb Fixed new linter warnings 2016-01-05 10:11:44 -08:00
Ron Buckton cde12efec5 Merge branch 'master' into glob2 2016-01-04 12:24:44 -08:00
Zhengbo Li 8cf1a34f70 enable more than one callbacks for a watched file 2015-12-28 14:05:32 -08:00
Zhengbo Li 56a7217241 Merge branch 'master' of https://github.com/Microsoft/TypeScript into i6016 2015-12-22 16:13:38 -08:00
Zhengbo Li 631363fee1 Fix lint issues 2015-12-22 15:38:52 -08:00
Zhengbo Li caa6eb4204 Reuse watchers between 'watchDirectory' and 'watchFile' 2015-12-22 15:26:21 -08:00
Zhengbo Li 178b2dabfe Add type alias for filewatching callbacks 2015-12-21 17:02:00 -08:00
Daniel Rosenwasser 0a470add81 Removed unused declarations from 'sys.ts'. 2015-12-17 14:38:17 -08:00
Zhengbo Li 602cde4cc1 Merge branch 'master' of https://github.com/Microsoft/TypeScript into i6016 2015-12-15 08:49:05 -08:00
Zhengbo Li d41901576a Use FileMap instead of string array 2015-12-15 08:39:51 -08:00
Ron Buckton 247657ffb5 Merge branch 'master' into glob2 2015-12-14 18:13:56 -08:00
Ron Buckton d8572508ee Heavily revised implementation that relies on an updated 'readDirectory' API. 2015-12-14 15:21:12 -08:00
Paul van Brenk 9d1cc31144 Merge pull request #6074 from Microsoft/supportChakra
make ChakraHost more generally usefull
2015-12-11 16:55:39 -08:00
Paul van Brenk 27493736c3 trailing whitespace 2015-12-11 16:32:44 -08:00
Paul van Brenk 0c365daac5 make ChakraHost more generally usefull 2015-12-11 16:19:08 -08:00
Zhengbo Li 564c4af59b Rollback to polling file watching 2015-12-10 23:27:07 -08:00
Zhengbo Li 36cc0e017b fix linter errors 2015-12-10 17:59:07 -08:00
Zhengbo Li 5fa7bec226 revert back to polling watching for approaching release 2015-12-10 17:54:03 -08:00
Zhengbo Li e67574446a Fix too many watcher instances issue 2015-12-09 16:21:04 -08:00
Ron Buckton def3ba1085 Added stubs to ChakraHost interface for readDirectoryNames/readFileNames 2015-12-07 15:32:32 -08:00
Ron Buckton 5de2fcc100 Merge branch 'master' into glob2 2015-12-07 15:15:22 -08:00
Ron Buckton f9ae3e4f2b Initial support for globs in tsconfig.json 2015-12-03 10:44:24 -08:00
Paul van Brenk dfb32c5dae Simplified after CR feedback. 2015-12-02 11:49:54 -08:00
Paul van Brenk 8d3e4f3475 cr feedback 2015-12-01 17:44:43 -08:00
Paul van Brenk 956a6b720a Add support for Chakra Host in sys. 2015-12-01 16:18:06 -08:00
Wesley Wigham 8a93b48945 fix lint: prefer const 2015-11-04 14:51:36 -08:00
Martin Všetička 30499e7ee5 Support '/dev/stdout' as a valid '--out' parameter 2015-11-03 08:05:49 +01:00
Daniel Rosenwasser 40f10abe01 Forget about tty detection. It won't work in build tools. 2015-11-02 15:23:15 -08:00
Daniel Rosenwasser fa2e614f9f Merge branch 'master' into iFeelPrettyErr 2015-10-30 18:10:05 -07:00
zhengbli 3e37b3158b Address code review at 5127 2015-10-14 21:36:35 -07:00
zhengbli fcfc25eeb0 Fix lint errors 2015-10-14 16:57:08 -07:00
zhengbli 002f0c066b CR feedback 2015-10-14 15:10:05 -07:00
zhengbli 8171dede90 Lint fixes and test fixes 2015-10-06 12:33:06 -07:00
Daniel Rosenwasser c3e00a24f3 Only use colors if we are certain we are using a pseudoterminal. 2015-10-05 23:38:32 -07:00
Daniel Rosenwasser 7c73a661c5 Merge branch 'master' into iFeelPrettyErr
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/sys.ts
	src/compiler/tsc.ts
2015-10-05 23:08:59 -07:00
zhengbli f7e35d5975 Incorporating changes from #3780 2015-10-05 16:19:09 -07:00
zhengbli 17f0cce772 Update comments 2015-10-05 14:31:43 -07:00
zhengbli 7741ec0999 Use fs.watch for all directory watchers and some bug fixes 2015-10-05 14:07:51 -07:00
zhengbli 9db53f23cf Add directory watcher to tsc 2015-10-05 13:12:13 -07:00
zhengbli 7fa26adf28 Redesigned directory watchers 2015-10-05 02:58:40 -07:00
Zhengbo Li 98eaeba4f1 temp save 2015-10-02 11:49:30 -07:00
Zhengbo Li 4dcf8c7737 bug fixes 2015-10-01 15:59:03 -07:00
Zhengbo Li 5daa100bf4 unify the node filewatcher in sys.ts and server.ts 2015-10-01 15:40:13 -07:00
zhengbli 0bc5c14d51 Change fileWatcher in sys for node 4 2015-10-01 15:25:43 -07:00
Mohamed Hegazy 7e6a27f1f7 Merge branch 'master' of https://github.com/Microsoft/TypeScript 2015-10-01 09:38:22 -07:00
Mohamed Hegazy 2b6d2a9f71 Merge branch 'master' of https://github.com/ShyykoSerhiy/TypeScript into ShyykoSerhiy-master
Conflicts:
	src/compiler/sys.ts
	src/compiler/tsc.ts
2015-09-30 16:30:49 -07:00
Wesley Wigham b95e1ff6d8 This is what zero linter errors feels like 2015-09-30 16:10:52 -07:00
Daniel Rosenwasser ea1882d76d Merge branch 'master' into iFeelPrettyErr
Conflicts:
	src/compiler/sys.ts
	src/compiler/tsc.ts
2015-08-18 01:25:00 -07:00
Vladimir Matveev bc3025b391 make 'require is defined' a precondition for Node-based sys 2015-08-14 20:53:38 -07:00
Vladimir Matveev 5a48508ffa adjust check for node env to handle webpack\browserify 2015-08-13 13:14:38 -07:00
Wesley Wigham 91f034669d Conform lint of the future, unify quotations 2015-08-04 13:33:01 -07:00
Wesley Wigham 5a6d476797 Fix as many linter errors as possible 2015-08-04 13:31:25 -07:00
Daniel Rosenwasser dda058b85e Use 'process.stdout.write' to ensure colors get displayed correctly on Windows. 2015-07-24 12:18:18 -07:00
Mohamed Hegazy c54947102a Merge pull request #3682 from Microsoft/nodeSystemHostWriteSync
Node System host write - need to loop since writeSync might not write all bytes in one request
2015-07-13 15:50:58 -07:00
shyyko.serhiy@gmail.com 30888da8fa fixed indent issues 2015-07-09 13:12:50 +03:00
Dan Quirk 5dfa6104f9 Turn off a few rules and more cleanup post merge 2015-07-08 17:42:26 -07:00
shyyko.serhiy@gmail.com 1855a07580 Fix issue https://github.com/Microsoft/TypeScript/issues/3277 2015-07-08 13:26:44 +03:00
Daniel Rosenwasser ba7fadeb12 Add support to tell whether output directs to a terminal emulator. 2015-06-30 23:26:23 -07:00
Dirk Baeumer ddb60fc8ce Node System host write - need to loop since writeSync might not write all bytes 2015-06-30 10:49:15 +02:00
Mohamed Hegazy 224e7630ea use namespaces instead of modules in the codebase 2015-06-12 09:01:48 -07:00
Anders Hejlsberg 990f19b69e Merge branch 'master' into tsConfigExclude
Conflicts:
	src/compiler/sys.ts
2015-06-03 15:12:13 -07:00
Oleksandr Chekhovskyi f516ebd0e0 Follow symlinks when enumerating files in a directory 2015-06-01 09:12:26 +02:00
Anders Hejlsberg 70d2938f4f Support "exclude" property in tsconfig.json 2015-05-16 11:38:28 -07:00
Mohamed Hegazy 9fdeffeb08 Fix formatting and parameter names 2015-04-09 14:18:32 -07:00
Cyrus Najmabadi d10a54c6b0 Use for-of in more places. 2015-03-13 10:36:29 -07:00
Cyrus Najmabadi 29bfc15d9b use for-of in more places. 2015-03-13 09:41:54 -07:00
Anders Hejlsberg 25e52a3975 Ignore symbolic links when enumerating directories 2015-01-20 09:58:25 -08:00
Anders Hejlsberg c342b58b23 Adding reference to core.ts in sys.ts 2015-01-15 18:18:19 -08:00
Anders Hejlsberg f9f95ba614 Support for tsconfig.json files in command-line compiler 2015-01-15 13:22:23 -08:00
Daniel Rosenwasser be1eb3430c Put 'sys' into the 'ts' module. 2014-12-11 13:43:34 -08:00
Daniel Rosenwasser c5510444d9 Use __filename for 'getExecutingFilePath'. 2014-12-11 13:43:29 -08:00
Yui T d50ce1cb47 Refactoring compiler utility-related files to use short-hand 2014-11-18 12:05:40 -08:00
Daniel Rosenwasser c514b9231d Actually removed reference to the diagnostics file.
Addresses the original intention of #932.
2014-10-23 13:43:22 -07:00
Daniel Rosenwasser b371b02ea0 Addressed CR feedback. 2014-10-21 15:11:55 -07:00
Daniel Rosenwasser aac8b3fae5 Removed Diagnostics from sys.ts in order to avoid cyclical build dependency.
Specifically, processDiagnosticMessages.ts was dependent on sys.ts, which was dependent on the rest of the compiler,
which meant that in a broken state of diagnostics, you could never compile processDiagnosticMessages.ts.
2014-10-21 14:48:43 -07:00
Anders Hejlsberg 7d3c006992 Making sys.getMemoryUsage optional. 2014-08-14 13:05:39 -07:00
Anders Hejlsberg 4d62b488b7 Include memory usage in -diagnostics report 2014-08-14 10:52:24 -07:00
Vladimir Matveev 6e7c95b817 use writeSync instead of stdout.write to make sure that stream is flushed 2014-08-12 11:30:11 -07:00
Mohamed Hegazy 9222711ace change name of the flag to emitBOM 2014-08-06 14:24:47 -07:00
Mohamed Hegazy b1335e1795 add generateBOM switch 2014-08-06 11:37:59 -07:00
Daniel Rosenwasser 30509f1ecc Changed messages, got rid of 'oldProgram'. 2014-08-01 18:54:26 -07:00
Daniel Rosenwasser 91023227e4 Changed watchFile callback behavior.
We no longer recompile unless the new last-modified time is more recent.
2014-07-31 22:41:01 -07:00
Daniel Rosenwasser 617910b3d4 Support the '--watch' compiler flag. 2014-07-31 14:57:54 -07:00
Anders Hejlsberg 299f1c3390 Properly set exit code for process.
Supercedes #246.
Includes provisions for buggy behavior of WScript.Quit.
2014-07-25 11:01:09 -07:00
Anders Hejlsberg f3f5993770 Incorporating code review feedback. 2014-07-16 11:46:25 -07:00
Anders Hejlsberg c1d0fd979d More I/O fixes
Support for --charset command line option
File read and write errors are propagated into compiler diagnostics
emitFiles returns diagnostics in EmitResult
2014-07-16 10:57:05 -07:00
Vladimir Matveev 35ec15538a moved getCanonicalName to 'core' 2014-07-14 14:31:46 -07:00
Vladimir Matveev 3646788571 derive value of 'useCaseSensitiveFileNames' from underlying platform for node base implementation of 'sys' 2014-07-14 11:16:21 -07:00
Anders Hejlsberg bbd14c005d Fix for I/O performance problems
sys.readFile checks whether file exists before reading instead of relying on exceptions
sys.writeFile returns a boolean result and doesn't use exceptions to communicate errors
Disabled code to create directories until performance has been verified
2014-07-14 10:45:24 -07:00
Mohamed Hegazy 214df64e28 Add snapshot of compiler sources 2014-07-12 17:30:19 -07:00