Commit graph

763 commits

Author SHA1 Message Date
Daniel Rosenwasser 4cc1848a17 Merge pull request #2996 from Microsoft/lastOrUndefinedReplacement
Replace awkward last-element selection pattern with 'lastOrUndefined'
2015-05-03 22:28:51 -07:00
Frank Wallis 76dceb89e4 Rename parameter static -> isStatic, fixes 'static is a reserved identifier' error when running in strict mode (#3006) 2015-05-03 19:14:09 +01:00
Daniel Rosenwasser 4ebfee2051 Use 'lastOrUndefined' where appropriate in the compiler. 2015-05-01 18:34:26 -07:00
Mohamed Hegazy 689c09cb10 Merge branch 'whitneyit-feature/noEmitExtends' 2015-05-01 16:41:32 -07:00
Mohamed Hegazy 101aedbf4e Do not emit __extends if --noEmitHelpers is set 2015-05-01 16:29:41 -07:00
Ron Buckton 60ae9bd14d Fixes helpers in strict mode 2015-05-01 10:49:54 -07:00
James Whitney 76fa4b838f Add support for --noEmitHelpers flag
This PR is a Work In Progress that addresses multiple `__extends`
being output as described in #1350: Multiple `__extends` being output
when `--module amd` is set.

The issue still exists as of `v1.5.0 - f53e6a8`.

Apparently a fix was created for this in #1356 but according to #2009, a
[comment](https://github.com/Microsoft/TypeScript/issues/2009#issuecomment-74136291)
later indicated that this was never merged in.

Further conversation continued in #2487 but did not yield any result. I
refer to my earlier recommendation in #1350.

> My question is this, would the TypeScript team be open to a flag that
> can be passed to tsc that will generate something like the following
> ```ts
> define(["require", "exports", "__extends", './mammal'], function (require, exports, __extends, Mammal) {
>     var Human = (function (_super) {
>         __extends(Human, _super);
>         function Human() {
>             _super.apply(this, arguments);
>         }
>         return Human;
>     })(Mammal);
>     return Human;
> });
> ```

To continue with the naming convention I have chosen the flag
`--noEmitHelpers`.
2015-04-30 13:23:30 +10:00
Paul van Brenk 270a149571 Merge pull request #2963 from Microsoft/RenameHeritageClauseElement
Rename HeritageClauseElement to ExpressionWithTypeArguments + related methods.
2015-04-29 15:01:29 -07:00
Paul van Brenk 54ef1bf93d Rename HeritageClauseElement to ExpressionWithTypeArguments + related methods. 2015-04-29 14:49:03 -07:00
Vladimir Matveev 2184be883c addressed PR feedback 2015-04-29 13:56:17 -07:00
Vladimir Matveev 4a919d4f04 exclude 'default' from star exports 2015-04-29 11:43:23 -07:00
Vladimir Matveev 5f18d9b912 extract emitExportStar in separate function 2015-04-28 20:17:55 -07:00
Vladimir Matveev 3af5592243 allow module to reserve slots for names that they export 2015-04-28 18:51:29 -07:00
Vladimir Matveev 7037c6be11 removed redundant check 2015-04-28 16:37:08 -07:00
Vladimir Matveev 054b22ebc5 Merge remote-tracking branch 'origin/master' into localStorageForExportedNames 2015-04-28 16:19:13 -07:00
Vladimir Matveev aa1ad5233e generate local storage for all exported names to avoid overwriting them via star exports 2015-04-28 16:18:33 -07:00
Vladimir Matveev 6ce9176926 always emit files as modules when separateCompilation flag is specified 2015-04-27 15:47:49 -07:00
Mohamed Hegazy 32409f9b9b Merge branch 'master' into inlineSourceMaps 2015-04-27 10:11:43 -07:00
Vladimir Matveev af8925545e addressed PR feedback 2015-04-23 21:14:03 -07:00
Vladimir Matveev b1cc06e44c merge with master 2015-04-23 20:50:35 -07:00
Ron Buckton 1c40032579 Fixes his in decorator helpers 2015-04-23 15:36:07 -07:00
Mohamed Hegazy ae4474aa40 Merge branch 'fix-2036' of https://github.com/csnover/TypeScript into csnover-fix-2036 2015-04-23 10:21:11 -07:00
Jason Freeman 4487fa426b Rename iterator property of ForStatement to incrementor 2015-04-22 13:29:50 -07:00
Colin Snover 378b5ffd1a Add support for UMD-like module export format
The new module format enables global-less universal modules,
compatible with both AMD and CJS module loaders.

Fixes #2036.
2015-04-22 14:21:33 -05:00
Vladimir Matveev afc3dd3c62 addressed PR feedback 2015-04-21 22:27:42 -07:00
Ron Buckton 1295519b8f Updated emit for __decorator and __metadata helpers 2015-04-21 14:10:37 -07:00
Vladimir Matveev 3f7e64661d do not hoist non-top level block scoped variables 2015-04-21 08:41:54 -07:00
Vladimir Matveev 767d76241a added comments, fixed typo 2015-04-21 06:49:31 -07:00
Mohamed Hegazy 658bba9eaf Add --inlineSources option 2015-04-20 20:33:31 -07:00
Vladimir Matveev b4bd216013 fixed indentation in comments 2015-04-20 17:01:47 -07:00
Vladimir Matveev bef6e08993 added comments, updated test baselines 2015-04-20 16:56:36 -07:00
Vladimir Matveev 6e5082658d skip 'import ...' nodes when creating variable statement for imports 2015-04-20 14:17:38 -07:00
Vladimir Matveev dcb4c24b43 merge with master 2015-04-20 13:40:13 -07:00
Vladimir Matveev cc385530d1 rename local variable 2015-04-20 10:47:17 -07:00
Mohamed Hegazy c940b1651a Merge branch 'master' into inlineSourceMaps 2015-04-19 13:33:50 -07:00
Mohamed Hegazy c68f837052 Merge branch 'amd-es3' of https://github.com/Smarp/TypeScript into Smarp-amd-es3 2015-04-17 15:39:23 -07:00
TruongSinh Tran-Nguyen d55dcc61cc exports.default in ES5 vs exports["default"] in ES3 2015-04-17 20:29:05 +03:00
Mohamed Hegazy 3298327ad0 update comments 2015-04-17 10:16:53 -07:00
Mohamed Hegazy 6163f5e11d Add comment 2015-04-16 17:37:01 -07:00
Mohamed Hegazy a84e64698a Move amd-dependency erlier in the list 2015-04-16 17:32:40 -07:00
Mohamed Hegazy d25d55ecc1 Respond to code review comments 2015-04-16 17:26:06 -07:00
Mohamed Hegazy 55af7b36c7 Fix #2801: Sort module names for AMD preamble 2015-04-16 14:56:22 -07:00
Ron Buckton 3b74503898 Merge pull request #2750 from Microsoft/fixES6Clodule
Elide var when emitting a module merged with an ES6 class
2015-04-16 11:53:24 -07:00
Jason Freeman 1cda3dc45d Fix parenthesizeForAccess to always parenthesize NewExpressions and NumberLiterals 2015-04-15 17:22:19 -07:00
Vladimir Matveev 0feebd44b3 publish exported postfix operators as 'E("", ++x) - 1' and 'E("", --x) + 1' 2015-04-13 21:32:27 -07:00
Jason Freeman 15e39f72ea Change parenthesizeForAccess to check isLeftHandSideExpression 2015-04-13 17:29:42 -07:00
Jason Freeman 70c06ce8c6 Fix crash in emitter on rest parameters with binding patterns 2015-04-13 17:29:35 -07:00
Jason Freeman 2b83dfbf40 Properly emit nested destructuring in rest elements (fixes #2587) 2015-04-13 17:29:32 -07:00
Jason Freeman 051aa39f0d Some cleanup in emitDestructuring 2015-04-13 17:29:28 -07:00
Jason Freeman 1ec6164293 Remove unnecessary parameter to emitDestructuring 2015-04-13 17:29:25 -07:00