Commit graph

50 commits

Author SHA1 Message Date
Andrew Branch f383c3c42d
Add test for parenthesized variable and function keyword within ternary 2019-04-01 14:11:30 -07:00
Kagami Sascha Rosylight 6249b4c704 Remove ES2018 transforms for ES2018 target (#26315)
* rename esnext.ts as es2018.ts

* remove ES2018 transforms for ES2018 target

* change target from esnext to es2018

* rename tests
2019-02-06 15:35:52 -08:00
Alexander e219b17ff0 TupleType - add additional tests to handle error on extra comma 2018-12-08 20:50:09 +02:00
Andy 36dfd775b3
Parse an object literal property as shorthand unless followed by '(' or ':' (#28121) 2018-10-26 15:00:31 -07:00
Ron Buckton f67afa098f Unpatch vfs resolver and default lib rename 2018-05-03 14:18:50 -07:00
Wesley Wigham 9e51882d9c
Numeric separators (#20324)
* Add support into octal and binary literals

* Add hex support

* And finally support all numeric literals and fix spelling

* Update error message

* Refactor error in scanner to take a position

* Scan no separators in escape sequences, add escape sequence tests

* More decimal tests from the spec presentation examples

* Permissive scanning of excess separators

* Remove unnecessary assignment

* Make code easier to follow
2017-12-08 20:20:18 -05:00
Andy 7e8851e65b
Always require '=' before parsing an initializer (#19979)
* Always require '=' before parsing an initializer

* Fix fourslash tests
2017-11-14 07:15:59 -08:00
Andy 9d8a854ea2
Revert "Break out of speculative parsing on bad parameter initializer (#19158)" (#19975)
This reverts commit e7df83263d.
2017-11-13 13:22:09 -08:00
Andy e7df83263d
Break out of speculative parsing on bad parameter initializer (#19158)
* Break out of speculative parsing on bad parameter initializer

* Remove uses of 'finally'

* give up -> stop

* Do without exceptions

* Remove `resetAfterSpeculation`

* Use Fail and FailList objects

* Remove `inSpeculation` parameter to parseDelimitedList

* Don't use `createNodeArray`, it's not always in scope

* Move Fail and FailList inside initializeState

* More code review

* More code review
2017-11-13 09:18:36 -08:00
Wesley Wigham 25c3b99f29 Add skip lib check to many tests (#18935)
* Add skip lib check to many tests, do not include unit test duration in profiler duration

* Add a few more skipLibCheck flags

* A few more

* Add more skip lib check flags
2017-10-04 13:14:05 -07:00
Daniel Rosenwasser 6a34dc953a Added test and accepted baselines. 2017-09-21 02:07:33 -07:00
Nathan Shively-Sanders d8ace9ddfb Don't parse param init when = is required but missing
Makes another test case pass that was taking exponential time to parse,
because now it notices that the = is not present and doesn't even try to
parse the initialiser expression.
2017-09-12 14:41:51 -07:00
Nathan Shively-Sanders 4c4316da72 Fail spec parsing lambdas on parameter missing a =
Fail speculative parsing of arrow function expressions whenever it has a
parameter with an initialiser that is missing '='. Ordinarily this is
allowed for better error recovery in the language service, but for
speculative parsing, the errors can compound. When the initialiser is an
error, and when the '=>' is missing (which is also allowed), what is
putatively an arrow function may actually be something else.

For example, `(a / 8) + function ()
{ }` is currently parsed as if someone had intended to write

`(a = /8)+function()/) => { }` but they forgot the `=` of the
initialiser, the `=>` of the lambda, forgot to close the regular
expression, and mistakenly inserted a newline right after the regular
expression.
2017-09-12 14:01:49 -07:00
Nathan Shively-Sanders a5c2eac2ee Test:disable lookahead in isStartOfParameter 2017-09-06 15:54:14 -07:00
Ron Buckton 6a737c88f7 Move async generators to esnext 2016-12-30 14:10:11 -08:00
Ron Buckton 0d7c9dc4e0 Merge branch 'master' into asyncGenerators 2016-12-30 13:05:01 -08:00
Yuichi Nukiyama 40252248e0 remove extra tests 2016-11-25 07:10:05 +09:00
Yuichi Nukiyama 94c78961ef modify error message 2016-11-19 16:18:20 +09:00
Yuichi Nukiyama 725dbc2add Merge branch 'master' into defult_export_error_message 2016-11-19 10:51:42 +09:00
Ron Buckton c72509b190 Added iterationMode switch, consolidate some tests, cleanup 2016-11-18 16:50:43 -08:00
Yuichi Nukiyama e65cdc3953 change error message 2016-09-24 10:18:49 +09:00
Anders Hejlsberg b14b24a96e Update tests 2016-09-21 16:03:51 -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
Vladimir Matveev 238e1c6f4b partially suppress reachability errors in tests 2015-10-13 11:17:10 -07:00
Vladimir Matveev bc02341e99 addressed PR feedback, updated tests to suppress reachability errors where they are not needed 2015-10-13 10:58:55 -07:00
Arthur Ozga 80db03efaa Added a regex test 2015-07-24 15:28:48 -07:00
Daniel Rosenwasser 50c4290da6 Merge branch 'master' into testPerf
Conflicts:
	Jakefile.js
	src/compiler/program.ts
	src/compiler/types.ts
	src/harness/harness.ts
	src/harness/projectsRunner.ts
	src/harness/runner.ts
2015-06-08 14:45:38 -07:00
Cyrus Najmabadi 2bf19e80c3 Speed up tests by not type-checking lib.d.ts unless the test asks for that. 2015-06-04 01:03:02 -07:00
Daniel Rosenwasser f5bcd9d157 '/// <reference no-default-lib="true"/>' -> '// @noLib: true' 2015-05-05 17:38:45 -07:00
Daniel Rosenwasser 8add21446b Update tests to use '@noLib: true'. 2015-05-05 17:29:49 -07:00
Daniel Rosenwasser 33028d5199 Replace uses of 'Symbol.isRegExp' with 'Symbol.toPrimitive'. 2015-04-09 14:06:57 -07:00
Jason Freeman 5596993351 Merge branch 'master' into forOf
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	tests/baselines/reference/APISample_compile.js
	tests/baselines/reference/APISample_compile.types
	tests/baselines/reference/APISample_linter.js
	tests/baselines/reference/APISample_linter.types
	tests/baselines/reference/APISample_transform.js
	tests/baselines/reference/APISample_transform.types
	tests/baselines/reference/APISample_watcher.js
	tests/baselines/reference/APISample_watcher.types
2015-02-18 14:49:10 -08:00
Jason Freeman f7a6354470 More resilient error recovery when declaration in for-of is empty 2015-02-18 11:35:43 -08:00
Jason Freeman 7fe286061d Add tests for for-of 2015-02-18 11:35:33 -08:00
Jason Freeman ebdd96bacf Update tests to use new symbol keyword 2015-02-06 21:32:05 -08:00
Jason Freeman 39952b1a93 Syntactically allow computed properties everywhere if the name looks like a built in Symbol 2015-02-06 21:31:27 -08:00
Jason Freeman 11d75ef4ce Allow Symbol indexer in ES6 2015-02-06 21:31:20 -08:00
Jason Freeman de3eb36b2c Update baselines 2015-01-19 16:36:50 -08:00
Yui T 1cc0d184bb Move grammar checking: shorthandPropertyAssignment; Add more parser test; there are still errors from incomplete migration 2014-12-14 19:14:02 -08:00
Yui T c1d509a940 Update and add test cases 2014-12-08 15:47:24 -08:00
Jason Freeman 1a8816f459 Address feedback 2014-11-26 20:10:49 -08:00
Jason Freeman cf4f34c224 Add parser tests for computed properties 2014-11-25 16:08:53 -08:00
Cyrus Najmabadi 6fdc5dc148 Move parameter name 'strict' checking to the grammar walker. 2014-11-18 17:01:39 -08:00
Mohamed Hegazy cffc62aa1b Report duplicate identifier errors on all locations for merged declarations to align with local declarations 2014-10-14 15:18:44 -07:00
Cyrus Najmabadi 0e9134788a Port fidelity changes to github. 2014-09-18 15:37:16 -07:00
Jason Freeman 3388f7bd48 Update baselines 2014-08-27 16:58:31 -07:00
Jason Freeman cc20bb19d0 Baseline and harness changes 2014-08-25 10:55:22 -07:00
Jason Freeman 083815893b Add test for octal literals in es3 strict mode 2014-08-06 18:10:19 -07:00
Daniel Rosenwasser c777d5c68a Report error on unclosed multiline comment.
Fixes #22
2014-07-15 12:21:16 -07:00
Mohamed Hegazy 214df64e28 Add snapshot of compiler sources 2014-07-12 17:30:19 -07:00