Commit graph

1343 commits

Author SHA1 Message Date
Ron Buckton 30433c2c67 ES6 cleanup 2016-03-02 11:38:30 -08:00
Vladimir Matveev 1e2d4773a1 Merge pull request #7283 from Microsoft/noRedundantContinue
do not emit explicit 'continue' in converted loops
2016-03-01 12:15:03 -08:00
Ron Buckton a0dbe7601c PR Feedback 2016-02-29 17:35:50 -08:00
Ron Buckton b1d88282ce Remove transformCompatibleEmit flag and make it the default. 2016-02-29 13:29:03 -08:00
Daniel Rosenwasser dbf8b02656 Use single-quoted strings in certain places. 2016-02-29 11:13:20 -08:00
Vladimir Matveev 24511ad1d7 do not emit explicit 'continue' in converted loops 2016-02-28 08:57:45 -08:00
Vladimir Matveev 66cf56e1e0 emit temp declarations after export equals 2016-02-25 20:48:15 -08:00
Ron Buckton e5cd8fef21 Added temporary compat flag to control emit output to fix tests 2016-02-23 11:35:26 -08:00
Ron Buckton 6d273366d3 Merged some changes from other branches. 2016-02-22 16:10:32 -08:00
Ron Buckton 90a317f62e Merge branch 'transforms-transformer' into transforms-printer 2016-02-22 15:58:33 -08:00
Ron Buckton ad64877dee Merged some changes from other branches. 2016-02-22 15:15:09 -08:00
Mohamed Hegazy 353998a6bd Rever change to EmitOutput.diagnostics 2016-02-18 12:06:17 -08:00
Anders Hejlsberg 1f096bd080 Add '!' non-null assertion postfix operator 2016-02-17 18:44:15 -08:00
Mohamed Hegazy eed65a0334 Port #7106 to master 2016-02-16 22:01:28 -08:00
Nathan Shively-Sanders e7aa7e4958 Merge branch 'master' into this-function-types 2016-02-16 13:57:25 -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
Ron Buckton 6b381ecdbd Added printer 2016-02-09 13:43:40 -08:00
Mohamed Hegazy d27d10ce2f Merge pull request #6884 from Microsoft/emitModulesInLooseMode
Add flag to emit modules in loose mode
2016-02-05 16:51:28 -08:00
Mohamed Hegazy 6f804e40ef change flag name 2016-02-05 16:30:01 -08:00
Kanchalai Tanglertsampan f35ab8c620 Port fix6901 from release-1.8 to master
Fix where we start checking for super-call

Update baselines

Address PR
2016-02-05 10:23:24 -08:00
Ron Buckton 8bf176ac3d Cleanup and reorganization of node tests 2016-02-04 16:41:58 -08:00
Vladimir Matveev d436d15304 addressed PR feedback 2016-02-04 12:44:31 -08:00
Mohamed Hegazy 1611f56481 Rename flag 2016-02-04 12:44:03 -08:00
Vladimir Matveev dbcfe110f1 propagate back assignments to block scoped binding from the loop body 2016-02-03 23:48:24 -08:00
Mohamed Hegazy 10522f9eee Add flag to emit modules in loose mode 2016-02-03 14:16:22 -08:00
Nathan Shively-Sanders 8032b06f33 Merge branch 'master' into this-function-types 2016-02-02 16:16:46 -08:00
T18970237136 dbfc269e42 Add missing semicolon when emitting return statement.
Fixes #6824.
2016-02-02 08:54:07 +01:00
Daniel Rosenwasser 0855933757 Merge pull request #6587 from nojvek/master
pretty output for jsx and createElement emits to children array
2016-02-01 21:38:15 -08:00
Vladimir Matveev e168e945e5 Merge pull request #6770 from Microsoft/dottedNamesInSystem
properly handle dotted namespace names in System modules
2016-02-01 10:01:05 -08:00
Vladimir Matveev 4d2cd6f88b properly dotted namespace names in System modules 2016-01-31 12:10:33 -08:00
Anders Hejlsberg f0abb86158 Removing MultiLine, Synthetic, DeclarationFile, and OctalLiteral flags 2016-01-31 08:08:19 -08:00
Noj Vek bd86e2ec80 remove uncommented lines 2016-01-30 11:31:43 -08:00
Ron Buckton fe23cc3c44 Merge pull request #6684 from Microsoft/fixDecoratedClassName
Fix ES6 decorated class double binding.
2016-01-29 17:37:24 -08:00
Nathan Shively-Sanders a639b71ed0 Skip emit of this types as first parameter. 2016-01-29 14:34:44 -08:00
guybedford 94fe3e0fb2 set __moduleName from context.id argument 2016-01-29 18:42:23 +02:00
Noj Vek fcd96cb3d8 fix tslint 2016-01-28 23:33:14 -08:00
Noj Vek 238fcbcee9 single iteration through children array without any array allocation 2016-01-28 23:29:08 -08:00
Ron Buckton 0978639ab2 Merge branch 'master' into fixDecoratedClassName 2016-01-28 17:53:56 -08:00
Ron Buckton 39077f6866 PR feedback 2016-01-28 15:25:42 -08:00
Ron Buckton 1bb96555da Creates a class body scoped alias to the class to avoid class name double binding.
Fixes #5386.
2016-01-27 16:13:51 -08:00
Vladimir Matveev 5b68d6559a strip quotes from module names during deduplication 2016-01-27 15:34:53 -08:00
Ron Buckton a6af98e100 Merge pull request #6631 from Microsoft/reservePromiseInTopLevelModule
Reserve promise in top level module
2016-01-27 12:25:57 -08:00
Vladimir Matveev e67ff39e17 merge with origin/master 2016-01-27 10:40:52 -08:00
Noj Vek a116b4c996 pretty output for react jsx 2016-01-26 22:59:34 -08:00
Kanchalai Tanglertsampan bc2599083c Merge branch 'master' into fix4867_transpiling 2016-01-26 15:37:49 -08:00
Ron Buckton 95422fa595 merge branch 'alternateFixSuperInAsyncMethod' into reservePromiseInTopLevelModule 2016-01-26 12:26:49 -08:00
Ron Buckton da6aadbea8 Merge branch 'master' into alternateFixSuperInAsyncMethod 2016-01-26 11:49:30 -08:00
Ron Buckton b00cae87b3 Moved isSuperPropertyOrElementAccess to utilities 2016-01-26 11:36:20 -08:00
Ron Buckton 4d3f6e76b8 Error for Promise redeclaration in module with async 2016-01-25 10:32:34 -08:00
york yao d06d66cf5d use a local string rather than a function 2016-01-25 13:35:12 +08:00
york yao 72c3bb6930 extract a helper method 2016-01-25 10:48:23 +08:00
york yao 88676d680f a better way since languageVersion is a number 2016-01-25 07:50:22 +08:00
york yao ac196eb2aa use const rather than var when emitting external import declaration and the target is es6 2016-01-24 17:10:44 +08:00
Ron Buckton 6084dec8b9 Merge branch 'master' into alternateFixSuperInAsyncMethod 2016-01-21 16:52:45 -08:00
Yui T a1acf8f0f3 Merge branch 'master' into fix4867_transpiling 2016-01-21 16:19:25 -08:00
Yui T 125d1f448a Address PR 2016-01-21 16:16:52 -08:00
Ron Buckton 2374f1f9a5 Merge branch 'master' into moveEmitFlagsToBinder 2016-01-20 17:53:47 -08:00
Vladimir Matveev a2c655d683 handle block scoped binding in nested blocks 2016-01-20 15:23:46 -08:00
Ron Buckton 56141c2f84 Merge pull request #6506 from Microsoft/awaiterUpdate
Updated version of __awaiter.
2016-01-19 16:37:10 -08:00
Ron Buckton 6e5948f622 Merge branch 'master' into moveEmitFlagsToBinder 2016-01-19 16:13:38 -08:00
Daniel Rosenwasser 26fdf891e9 Fix lint errors. 2016-01-16 14:05:46 -08:00
Ron Buckton 5943f043ea Merge branch 'master' into alternateFixSuperInAsyncMethod 2016-01-15 12:51:30 -08:00
Ron Buckton 7079de8b93 Updated version of __awaiter.
Fixes #5941.
2016-01-15 12:40:34 -08:00
Vladimir Matveev 0a0c3e0cbd do not crash if initializer in For-statement is missing 2016-01-14 23:20:21 -08:00
Ron Buckton fb1ad3231c Move emit helper flags to binder. Fixes #6113 2016-01-14 17:51:34 -08:00
Mohamed Hegazy 869b81162f Merge pull request #6019 from Microsoft/sourceMapDestructuring
Fixes for source map of destructuring downlevel syntax
2016-01-11 14:36:28 -08:00
Kanchalai Tanglertsampan 62256bd3c6 Merge branch 'master' into fix4867_transpiling 2016-01-10 18:04:15 -08:00
Mohamed Hegazy cc1947b94f Rename jsxNamespace to reactNamespace 2016-01-07 13:59:25 -08:00
Mohamed Hegazy c0b28a3a40 Merge branch 'react-factory-option' of https://github.com/rwyborn/TypeScript into rwyborn-react-factory-option
Conflicts:
	src/compiler/checker.ts
2016-01-07 13:50:03 -08:00
Vladimir Matveev dbe8489087 Revert "Merge pull request #6098 from guybedford/master"
This reverts commit 996f16940e, reversing
changes made to 51fd41b0c7.
2016-01-05 10:40:24 -08:00
Mohamed Hegazy 996f16940e Merge pull request #6098 from guybedford/master
Naive implementation for #6097
2016-01-04 09:38:27 -08:00
Nathan Shively-Sanders ec4c6fea2d Merge branch 'master' into lint-nested-++ 2016-01-04 08:56:05 -08:00
Ryan Cavanaugh 3288f5bb6d Make linter happy 2015-12-29 13:16:00 -08:00
Ryan Cavanaugh e12855bca0 Escape quotes when they appear as HTML entities in JSX text
Fixes #6241
2015-12-29 12:39:27 -08:00
Sheetal Nandi acf54bb416 Merge branch 'master' into sourceMapDestructuring 2015-12-22 16:21:38 -08:00
Nathan Shively-Sanders abf9961528 Merge branch 'master' into lint-nested-++ 2015-12-22 16:12:07 -08:00
Nathan Shively-Sanders 401a393519 Fix ++/-- lint 2015-12-22 15:45:00 -08:00
Yui T 2fc906ef33 Address PR 2015-12-21 17:07:18 -08:00
Yui T 677e080dad Add tests 2015-12-21 16:23:51 -08:00
Daniel Rosenwasser 3969b89b23 Fixups for #6163. 2015-12-21 13:40:59 -08:00
Dan Corder aba197cd4b Fix issue #5810 doubled comment on functions in array literals 2015-12-18 22:35:08 +00:00
Vladimir Matveev a8f87bb2ca only '++' and '--' unary operators can change exports 2015-12-18 11:21:31 -08:00
Rowan Wyborn 9d11f2b3ce Merge branch 'master' into react-factory-option 2015-12-18 21:57:38 +11:00
Rowan Wyborn b7f60704bb Initial check in - Support other JSX factories Issue #3788
- added jsxNamespace compile option
- when jsx mode is "react", jsxNamespace optionally specifies the emit namespace for React calls, eg "--jsxNamespace MyDOMLib" will emit calls as MyDOMLib.createElement (instead of React.createElement)
- symbol specified by jsxNamespace must be present, else compile error is generated (same handling as is done for React symbol when no jsxNamespace is specified)
2015-12-18 21:56:08 +11:00
Daniel Rosenwasser 66cf6be6d8 Removed unused declarations in 'emitter.ts'. 2015-12-17 14:55:08 -08:00
Sheetal Nandi 8f98e3f160 Merge branch 'master' into sourceMapDestructuring 2015-12-17 13:29:45 -08:00
Guy Bedford f0a8bf566c add __moduleName to System.register 2015-12-14 18:01:55 +02:00
Sheetal Nandi df3a74b6ca Removed some unnecessary changes and added comments 2015-12-10 15:35:47 -08:00
Sheetal Nandi 513e1f5fce If the destructuring assignment is synthetic use the left side as source map
This helps in scenarios like below where the assignment is created synthetically
for ({a} of {a: string}) {
}
2015-12-10 15:03:10 -08:00
Sheetal Nandi 7d60c5e630 Fix the temporary assignment source maps in a better way
This doesnt create synthetic nodes with source map node on them
And makes us determine what to put source map on for temporary assignments
2015-12-10 14:10:34 -08:00
Sheetal Nandi 8948f9be50 Add support for modifying last encoded source map's source location
With this, we can just highlight the bindingElement when the temp variable
for it is assigned.
Note there are few scenarios like below which would still highlight let part
but thats because of how default value source mapping is currently which is next
in pipeline to support binding element with default values
for (let {name: nameA, skill: skillA } of robots) {
    console.log(nameA);
}
or
for (let [numberA2, nameA2, skillA2] of robots) {
    console.log(nameA2);
}
2015-12-10 12:29:14 -08:00
Sheetal Nandi 9fd525bc7c Simplify the array binding pattern element to determine what to highlight 2015-12-09 13:02:09 -08:00
Sheetal Nandi 35ec9caf65 Make sourcemap of "For" that initializes vars using object literal binding pattern better 2015-12-09 12:39:48 -08:00
Sheetal Nandi b1d395c4cf Make the destructuring array literal assignment better with sourcemap 2015-12-09 12:39:31 -08:00
Sheetal Nandi edd55ddf51 Make the source map of "for of" destructuring - object binding pattern better 2015-12-09 12:39:09 -08:00
Sheetal Nandi de7626356c Better the destructuring of nested array binding pattern 2015-12-09 12:38:52 -08:00
Sheetal Nandi 7c618a494d Better the sourcemap for array binding pattern 2015-12-09 12:38:43 -08:00
Sheetal Nandi 8af2160922 Make nested object literal destructuring pattern better 2015-12-09 12:38:26 -08:00
Sheetal Nandi 4ebf5695a7 Better sourcemaps for destructuring 2015-12-09 12:38:17 -08:00
Daniel Rosenwasser 99ea3ca9b5 Moved a paren. 2015-12-08 17:49:11 -08:00
Vladimir Matveev 268e7c0d09 Merge remote-tracking branch 'origin/master' into elideExportStarForNonValues 2015-12-08 13:15:56 -08:00
Ryan Cavanaugh 05c17032a9 Actually include the fix.... 2015-12-07 11:57:54 -08:00
Wesley Wigham 9b441d8343 Merge pull request #5148 from weswigham/duplicate-export-behavior
Make export var or export *'s with duplicate identifiers an error
2015-12-04 14:18:58 -08:00
Wesley Wigham bc73f31acc Fix #5928 - Write line after shebang 2015-12-04 13:38:24 -08:00
Wesley Wigham 83e61cfa68 fix esmodule big, unify export emit between es6/pre-es6 2015-12-02 20:50:24 -08:00
Mohamed Hegazy 19d7e629da Merge pull request #5852 from holtwick/feature/await_for_es5
Enable await in ES5 and ES2015 script mode
2015-12-01 17:08:09 -08:00
Ron Buckton 7d920c2aad Merge pull request #5841 from Microsoft/fixAsyncReferencedImport
Fixes #5789.
2015-12-01 15:04:10 -08:00
Wesley Wigham 02d96f67bb trio of missed style nits 2015-12-01 14:57:59 -08:00
Wesley Wigham 0464138c84 Merge pull request #5866 from weswigham/unnamed-default-exports
Fix #5844 - add many new tests covering named/anonymous default exports
2015-12-01 14:36:02 -08:00
Sheetal Nandi 0c8aa41b26 Merge pull request #5835 from Microsoft/noEmit
Do not emit files if noEmit is specified
2015-12-01 14:34:28 -08:00
Ron Buckton 67a4fe5d67 Support for assignment/destructuring using super in an async method 2015-12-01 14:29:37 -08:00
Wesley Wigham cff83c5081 Fix #5844 - add many new tests covering named/anonymous default exports 2015-12-01 14:05:46 -08:00
Ron Buckton 88a43ccb4a Fix emit for type as expression 2015-12-01 12:12:31 -08:00
Dirk Holtwick acd1760c8c Fix whitespace issues 2015-12-01 20:32:53 +01:00
Dirk Holtwick c12d29bda5 Simplifying the pre ES6 async/await change 2015-12-01 20:26:20 +01:00
Ron Buckton 2745895064 Alternate approach to fix super calls in async methods. 2015-12-01 11:13:54 -08:00
Dirk Holtwick 1fb8a249df Enable await in ES6 and ES2015 script mode
Even though strictly generators are an ES6 feature the real world support
is large enough to use the feature in well known environments like
node.js or Electron app. Since the previous output was not working at
all anyway it feels like a good compromise to at least emit working code
while still having the warning in place. The user would also need to add
"use strict" on top of her .ts file to make it work with node.js.
2015-12-01 10:26:14 +01:00
Sheetal Nandi f315fc1c9e Merge branch 'master' into noSourcemapNames 2015-11-30 16:33:18 -08:00
Sheetal Nandi 322f084370 Merge branch 'master' into noSourcemapNames 2015-11-30 16:27:11 -08:00
Sheetal Nandi a87169829c Merge branch 'master' into sourceMapAndBreakpointDecorators 2015-11-30 14:14:06 -08:00
Sheetal Nandi ccfa625b32 var rename as per PR feedback 2015-11-30 14:03:28 -08:00
Ron Buckton 266600da08 Merge pull request #5780 from Microsoft/extractSourceMaps
Extract source map generation logic out of the emitter.
2015-11-30 12:51:36 -08:00
Sheetal Nandi acedf3c247 Do not emit files if noEmit is specified
Handles #5799
2015-11-30 12:46:53 -08:00
Wesley Wigham 8c40dc8fae Merge branch 'master' into duplicate-export-behavior 2015-11-25 17:54:08 -08:00
Wesley Wigham c9b3b7e42e Merge pull request #5661 from weswigham/use-common-directory-for-out
Use common source directory for calculating concatenated module paths
2015-11-25 17:18:48 -08:00
Wesley Wigham ec775ba4aa Merge pull request #5648 from weswigham/default-commonjs-es6
Handle default class exports when targeting es6 with non-es6 module kinds
2015-11-25 17:15:06 -08:00
Wesley Wigham d1c467ff4d Merge branch 'master' into use-common-directory-for-out 2015-11-25 16:41:58 -08:00
Ron Buckton b33eff1143 PR feedback 2015-11-25 12:47:32 -08:00
Ron Buckton 8909c3a2dd Merge pull request #5725 from Microsoft/stringTypesCleanup
Disambiguate string literal types from other string literals.
2015-11-24 15:23:25 -08:00
Sheetal Nandi a7cc86380d Merge branch 'master' into sourceMapAndBreakpointDecorators 2015-11-24 14:53:18 -08:00
Wesley Wigham 27149f3c88 only emit use strict if a use strict prologue isnt found 2015-11-24 13:31:30 -08:00
Ron Buckton 5c23a5f11e Extract source map generation logic out of the emitter. 2015-11-23 22:38:05 -08:00
Wesley Wigham a03f06f766 add strict mdoe directive to all nones6 module emits 2015-11-23 14:39:41 -08:00
Wesley Wigham 3b6fa314da new tests 2015-11-23 13:12:34 -08:00
Wesley Wigham a9be53093c change enum emit 2015-11-23 12:55:29 -08:00
Wesley Wigham 6a8e78cdc0 fix ES6 emit for namespaces to only emit one export binding 2015-11-23 12:43:28 -08:00
Vladimir Matveev 988a51237b address PR feedback - fixed typo in comment 2015-11-22 21:28:07 -08:00
Vladimir Matveev 181c943feb correctly capture 'this' when converting loops into functions 2015-11-21 20:11:39 -08:00
Wesley Wigham b11786866b Merge branch 'master' into use-common-directory-for-out 2015-11-20 13:32:12 -08:00
Ron Buckton 68c292c445 Adds a generic algorithm to create a shallow, memberwise clone of a node. 2015-11-19 17:42:12 -08:00
Ron Buckton f5b8619199 Adds StringLiteralType to SyntaxKind to disambiguate string literals in a type position. 2015-11-19 17:08:51 -08:00
Sheetal Nandi e23b0c65ea Fix the source map emit for decorators
Handled #5584
2015-11-19 16:48:29 -08:00
Sheetal Nandi a3bec922fb When the node contains decorators the actual start of the node is after skipping trivia from decorators end 2015-11-19 16:48:25 -08:00
Sheetal Nandi 883b8d9347 Merge pull request #5471 from Microsoft/jsFileCompilation
Compilation of Js Files
2015-11-19 16:30:40 -08:00
Ron Buckton 7d6100bbe8 Merge pull request #5719 from Microsoft/typesCleanup2
Additional Types cleanup.
2015-11-19 15:32:28 -08:00
Ron Buckton 93af2b2beb Comment cleanup. 2015-11-19 15:31:56 -08:00
Ron Buckton 5915fbd292 Adds minimal support for 'this' types in decorator metadata, emitting 'Object' for now. 2015-11-19 09:53:32 -08:00
Sheetal Nandi b73ce26937 Dont emit names index mapping into the sourcemap
Since sourcemap spec is not very clear about symbol translation and
use of nameIndex of the mapping, dont emit it
2015-11-18 15:29:51 -08:00
Wesley Wigham c7a3bee916 Merge branch 'master' into use-common-directory-for-out 2015-11-18 13:10:23 -08:00
Sheetal Nandi a19307d533 Merge branch 'master' into jsFileCompilation 2015-11-18 11:26:58 -08:00