Commit graph

693 commits

Author SHA1 Message Date
Mohamed Hegazy b9e503d891 Ellide uninstantiated exports in ES6 2015-03-23 12:37:22 -07:00
Mohamed Hegazy 86d561d2be Check for instantiation on export default in ES6 2015-03-23 11:17:40 -07:00
Mohamed Hegazy f90253f73e Merge branch 'master' into exportEquals
Conflicts:
	src/compiler/checker.ts
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/emitter.ts
	tests/baselines/reference/es6ImportDefaultBinding.errors.txt
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.errors.txt
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.errors.txt
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.errors.txt
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.errors.txt
	tests/baselines/reference/es6ImportDefaultBindingInEs5.errors.txt
2015-03-23 11:06:44 -07:00
Anders Hejlsberg 956d7a82f3 Fixing emit for import d, * as foo from "foo" case 2015-03-22 12:18:38 -07:00
Anders Hejlsberg 20d1f73087 Add support for exporting imported symbols 2015-03-22 09:10:10 -07:00
Anders Hejlsberg a1525157c7 Emit and use '__export' helper for 'export *' declarations 2015-03-21 15:46:16 -07:00
Anders Hejlsberg 6838d47834 Simplify collection of external module info in emitter 2015-03-21 15:09:54 -07:00
Anders Hejlsberg 57a9fc54c8 Separate 'export default' and 'export =' 2015-03-21 13:12:39 -07:00
Ron Buckton 0fb624a58b PR feedback 2015-03-19 22:57:03 -07:00
Vladimir Matveev 79272d7cef Merge pull request #2199 from Microsoft/enumCleanup
Fixes #2183, #1797
2015-03-19 11:27:11 -07:00
Vladimir Matveev 49c4b5ac13 extract declaration emitter to separate file 2015-03-18 16:37:52 -07:00
Vladimir Matveev 371f2df90d Merge pull request #2139 from Microsoft/DtsExports_all
Exports + .d.ts emit
2015-03-18 14:45:05 -07:00
Vladimir Matveev 2ad40c25c9 addressed PR feedback 2015-03-18 14:29:02 -07:00
Cyrus Najmabadi 035ad42c30 Simplify comment emit. 2015-03-17 19:25:40 -07:00
Cyrus Najmabadi 63e4420887 Simplify flow control. 2015-03-17 19:13:00 -07:00
Cyrus Najmabadi 9582d7cf28 Add test for pinned comments. 2015-03-17 18:43:39 -07:00
Cyrus Najmabadi 36b99511c6 Simplify code for emitting comments.
Also, always emit pinned comments, even when the 'removeComments' compiler
option is provided.
2015-03-17 18:34:42 -07:00
Vladimir Matveev b82fd590d2 merge with master, accept baselines 2015-03-17 18:23:43 -07:00
Ron Buckton ff356cef4c Added sourcemap tests 2015-03-17 18:15:02 -07:00
Vladimir Matveev c38e065b6b do not emit non-exported import declarations that don't have import clause 2015-03-17 18:00:40 -07:00
Vladimir Matveev e4f6f167f6 merge with master, accepted baselines 2015-03-17 17:05:30 -07:00
Ron Buckton 6c32a8bdb0 Updated baselines 2015-03-17 14:21:08 -07:00
Ron Buckton bd4d7fc9ee Emit for decorators, updated to ES6 classes. 2015-03-17 14:20:57 -07:00
Vladimir Matveev eb1160731e use type annotation when emitting declarations 2015-03-17 14:02:19 -07:00
Mohamed Hegazy a06ce61684 Merge branch 'master' into es6ImportExportEmit 2015-03-17 13:03:17 -07:00
Mohamed Hegazy 766cb68f7c Add comments 2015-03-17 13:03:13 -07:00
Anders Hejlsberg ad75193528 Merge branch 'master' into cleanupDiagnostics
Conflicts:
	src/compiler/program.ts
2015-03-17 06:26:24 -07:00
Mohamed Hegazy 1932f720cb Handel export name bindings in internal modules in ES6 2015-03-16 21:58:57 -07:00
Mohamed Hegazy 3d802438f1 Export classes defined wihtin internal modules correctelly 2015-03-16 21:18:31 -07:00
Mohamed Hegazy 99108694d5 Do not emit "export" for classes within modules, and do not write the name of an export default class 2015-03-16 20:54:28 -07:00
Mohamed Hegazy cb012e01fd Merge branch 'master' into es6ImportExportEmit
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
2015-03-16 20:47:08 -07:00
Mohamed Hegazy eb954e1cb5 Respond to code review comments 2015-03-16 19:25:02 -07:00
Vladimir Matveev 9b62c2c407 Merge branch 'master' into DtsExports_all 2015-03-16 19:10:01 -07:00
Vladimir Matveev 218736b23f initial version of declaration emit for default export 2015-03-16 18:54:13 -07:00
Yui T 9b3fccd5c4 Address code review; Use for..of and use if-statement 2015-03-16 16:24:40 -07:00
Vladimir Matveev e9ea336771 Merge branch 'master' into DtsExports_all 2015-03-16 16:22:28 -07:00
Yui T 513b45d101 Merge branch 'master' into emitClass
Conflicts:
	src/compiler/checker.ts
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/emitter.ts
	src/compiler/parser.ts
2015-03-16 15:55:57 -07:00
Yui T c51983df3c Address code review 2015-03-16 15:48:03 -07:00
Yui T 91c5bae6e5 Address code review 2015-03-16 15:41:51 -07:00
Yui T 88933d54cc Address code review 2015-03-16 15:20:40 -07:00
Mohamed Hegazy 5845d2d214 Merge branch 'master' into es6ImportExportEmit 2015-03-16 14:49:41 -07:00
Vladimir Matveev 7f8ef3881b addressed PR feedback 2015-03-16 13:36:34 -07:00
Vladimir Matveev f5a4b0b31a use 'allowGeneratedIdentifiers' to explicitly tell when identifier can be renamed 2015-03-16 12:37:21 -07:00
Mohamed Hegazy c984e81053 Fix issue of the default binding not elided if namedImport is reference
Conflicts:
	src/compiler/checker.ts
	src/compiler/emitter.ts
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.js
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportWithExport.js
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingDts.js
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.js
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingWithExport.js
2015-03-15 18:23:48 -07:00
Yui T 9bf5a11bef Update baselines 2015-03-15 16:29:41 -07:00
Mohamed Hegazy b6a6d85e6b Merge branch 'master' into es6ImportExportEmit
Conflicts:
	src/compiler/checker.ts
	src/compiler/emitter.ts
	src/compiler/program.ts
2015-03-15 15:48:23 -07:00
Yui T 2a07d3f8db Address code review: do not emit default constructor 2015-03-15 12:33:29 -07:00
Yui T 13e55ae8cb Address code review 2015-03-14 16:53:33 -07:00
Vladimir Matveev a7dac51e84 merge with master 2015-03-13 17:23:42 -07:00
Cyrus Najmabadi e5cd5eca3c Update LKG. 2015-03-13 16:49:22 -07:00
Cyrus Najmabadi 285497edf8 Reserve _i and _n as names we often want to generate 2015-03-13 16:45:58 -07:00
Cyrus Najmabadi d8d4719765 Add experimental option to cache the .length access in downlevel for-of emit. 2015-03-13 16:15:25 -07:00
Cyrus Najmabadi 4a9187172e Use 'let' in the compiler layer. 2015-03-13 15:55:17 -07:00
Anders Hejlsberg 00ac8361aa Merge branch 'master' into cleanupDiagnostics 2015-03-13 15:06:14 -07:00
Anders Hejlsberg 99a6f2b194 Removing unused function from emitter 2015-03-13 14:49:54 -07:00
Cyrus Najmabadi a6348c1e31 Use 'let' in the emitter. 2015-03-13 12:34:12 -07:00
Cyrus Najmabadi 29bfc15d9b use for-of in more places. 2015-03-13 09:41:54 -07:00
Cyrus Najmabadi 4642b869fa Use for-of in emitter.ts 2015-03-13 09:08:27 -07:00
Vladimir Matveev 879639615b merge with master 2015-03-12 18:28:57 -07:00
Mohamed Hegazy 8e0626555b Merge branch 'master' into es6ImportExportEmit 2015-03-12 17:21:48 -07:00
Mohamed Hegazy b3c8bcb319 Emit export default in ES6 2015-03-12 17:14:33 -07:00
Yui T af05afdc50 Emit Super as super 2015-03-12 16:34:06 -07:00
Mohamed Hegazy fe9fff506d Export * and export { names } emit in es6 format
Conflicts:
	src/compiler/emitter.ts
	tests/baselines/reference/es6ExportAll.js
	tests/baselines/reference/es6ExportClause.js
	tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.js
2015-03-12 11:51:32 -07:00
Mohamed Hegazy 680cf6d844 Emit export internal import equals declaration in es6 format 2015-03-12 10:34:39 -07:00
Mohamed Hegazy 6bcbe824aa Emit export class declaration in es6 format.
Note since we havent yet changed the emitting of class declaration to es6 format,
we are just exporting the constructor function

Conflicts:
	src/compiler/emitter.ts
2015-03-12 10:27:46 -07:00
Mohamed Hegazy b091fa57ef Emit export function declaration in es6 format
Conflicts:
	src/compiler/emitter.ts
2015-03-12 10:11:37 -07:00
Mohamed Hegazy 58d19595f0 Emit ES6 module enum declaration
Conflicts:
	src/compiler/emitter.ts
2015-03-12 10:00:48 -07:00
Mohamed Hegazy b9f63a85b1 Emit es6 export ModuleDeclaration
Conflicts:
	src/compiler/emitter.ts
	tests/baselines/reference/es6ExportAll.js
	tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.js
2015-03-12 01:38:35 -07:00
Sheetal Nandi 05932fdddf Es6 module emit for export VarDeclaration, export LexicalDeclaration
Conflicts:
	src/compiler/emitter.ts
	tests/baselines/reference/es6ExportAll.js
	tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.js
	tests/baselines/reference/es6ImportNamedImport.js
2015-03-12 01:29:53 -07:00
Sheetal Nandi 006ed82730 Remove references with exports.id as es6 module doesnt have exports.id
Conflicts:
	tests/baselines/reference/es6ExportAll.js
	tests/baselines/reference/es6ExportClauseWithoutModuleSpecifier.js
	tests/baselines/reference/es6ImportNamedImport.js
2015-03-12 00:52:14 -07:00
Sheetal Nandi 4b7548487c Fix the checks with language version to use default es3 2015-03-12 00:36:14 -07:00
Mohamed Hegazy 3ed8bcc179 Simplify module kind selection 2015-03-12 00:18:20 -07:00
Mohamed Hegazy 8c26507bd5 Support for emitting import declaration in es6 format
Conflicts:
	src/compiler/emitter.ts
	tests/baselines/reference/es6ImportDefaultBinding.js
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js
	tests/baselines/reference/es6ImportNameSpaceImport.js
	tests/baselines/reference/es6ImportNamedImport.js
2015-03-12 00:17:40 -07:00
Mohamed Hegazy 7b3e50fb98 Emit in ES6 module if script target is es6 or higher
Conflicts:
	src/compiler/emitter.ts
	tests/baselines/reference/es6ImportDefaultBinding.js
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.js
	tests/baselines/reference/es6ImportNameSpaceImport.js
	tests/baselines/reference/es6ImportNamedImport.js
2015-03-11 23:29:30 -07:00
Vladimir Matveev 751b1aee16 disallow recursive references for block-scoped bindings 2015-03-11 16:54:18 -07:00
Yui T 7ee587c43f Emit class with export and export default 2015-03-11 16:45:55 -07:00
Yui T a0a506b11b Emit class declaration with static property assignment 2015-03-11 16:13:08 -07:00
Yui T da12d465d0 Add tests for extension, type arguments, overload 2015-03-10 19:11:07 -07:00
Vladimir Matveev 76dcfb660b Merge pull request #2291 from Microsoft/letConstInSwitchStatements
introduce CaseBlock as a block-scoped container for switch statements
2015-03-10 18:33:54 -07:00
Vladimir Matveev 59c71acae8 introduce emitCaseBlock function 2015-03-10 18:17:52 -07:00
Vladimir Matveev efcf0e6f57 introduce CaseBlock as a block-scoped container for switch statements 2015-03-10 17:50:54 -07:00
Yui T 1b84f1d1d0 emit get/set member function 2015-03-10 17:22:33 -07:00
Yui T 8576282975 Emit non-getter/setter member function 2015-03-10 15:41:41 -07:00
Yui T d3205ef955 Remove redundant sourcemap span and comment. Differentiate between emit for below ES6 and above ES6 2015-03-10 15:21:38 -07:00
Yui T 033a83d44a Basic emit for class constructor without static property assignment 2015-03-10 12:12:41 -07:00
Jason Freeman f389aefc47 Fix call to emitNode after merge with master 2015-03-10 10:41:26 -07:00
Jason Freeman 1349a196a0 Merge branch 'master' of https://github.com/Microsoft/TypeScript into for-ofES5 2015-03-09 19:45:37 -07:00
Jason Freeman b15d8aa2b5 Address PR feedback 2015-03-09 19:45:14 -07:00
Cyrus Najmabadi 31cf443a28 Add specialized codepath for emitting without comments. 2015-03-09 15:47:23 -07:00
Cyrus Najmabadi bfbc18d6d7 rename emitNode to emitNodeWithoutSourceMap 2015-03-09 15:01:02 -07:00
Cyrus Najmabadi 103bb34d7b Merge branch 'master' into indentSimplification
Conflicts:
	src/compiler/emitter.ts
2015-03-09 13:04:24 -07:00
Jason Freeman a27fbff280 Merge branch 'master' of https://github.com/Microsoft/TypeScript into for-ofES5
Conflicts:
	tests/baselines/reference/parserES5ForOfStatement18.js
	tests/baselines/reference/parserES5ForOfStatement21.js
2015-03-09 11:17:31 -07:00
Cyrus Najmabadi 35b56aa69b Further simplification. 2015-03-09 01:07:02 -07:00
Cyrus Najmabadi 6340531a16 Simplify indentation code in the emitter. 2015-03-08 23:07:03 -07:00
Cyrus Najmabadi 29c06f9d6a Move variable closer to where it is used. 2015-03-08 22:35:28 -07:00
Cyrus Najmabadi c371f1e521 Make the preservation of formatting an optional experimental compiler flag. 2015-03-08 19:06:55 -07:00
Cyrus Najmabadi 21627384a8 Merge branch 'master' into propertyAccessEmit 2015-03-07 13:51:10 -08:00
Cyrus Najmabadi 2a990a8685 Preserve newlines for conditional expressions 2015-03-07 13:50:26 -08:00
Cyrus Najmabadi dddc4660a1 Simplify code to emit indent code. 2015-03-07 13:33:02 -08:00
Cyrus Najmabadi 680e48f507 Preserve newlines on either side of a binary expression. 2015-03-07 12:54:12 -08:00