Sebastian McKenzie
47ee2cc99f
simplify err.loc references
2014-11-03 17:53:08 +11:00
Sebastian McKenzie
6cc70f7465
compare code instead of ast for transformation tests
2014-11-03 17:52:59 +11:00
Sebastian McKenzie
20484c66c5
add types.inherits method that inherits loc, range, start, end etc
2014-11-03 17:52:50 +11:00
Sebastian McKenzie
171bcad870
make transformation tests compare output instead of ast
2014-11-03 17:52:15 +11:00
Sebastian McKenzie
c963c30107
fix errorWithNode line mapping
2014-11-03 17:50:25 +11:00
Sebastian McKenzie
795183569d
fix export default assignment bug
2014-11-03 14:40:47 +11:00
Sebastian McKenzie
9a3c973280
add removeLastNewline to generator and add newlines to generated nodes
2014-11-03 14:40:33 +11:00
Sebastian McKenzie
95f3ca6348
Merge branch 'master' into code-generator
...
Conflicts:
lib/6to5/transformers/classes.js
test/fixtures/transformation/source-maps/class/expected.js
test/fixtures/transformation/source-maps/class/source-mappings.json
2014-11-03 13:38:44 +11:00
Sebastian McKenzie
c17878913b
add classProps declaration to simplify/nicen up class property defining - closes #88
2014-11-03 13:36:23 +11:00
Sebastian McKenzie
f3d371869d
Merge branch 'master' into code-generator
...
Conflicts:
lib/6to5/register.js
2014-11-03 12:22:07 +11:00
Sebastian McKenzie
89ecd46b77
move _moduleFormatter transformer before useStrict transformer and remove duplicate use strict removing - fixes #114
2014-11-03 12:20:47 +11:00
Sebastian McKenzie
9f8e8d96a8
simplify hasParans for NewExpression
2014-11-03 12:15:57 +11:00
Sebastian McKenzie
6d961c1857
faster traverse.hasType with array of nodes
2014-11-03 12:15:27 +11:00
Sebastian McKenzie
e13a650d05
remove IfStatement making consequent and alternate blocks
2014-11-03 11:17:36 +11:00
Sebastian McKenzie
3cd7ed69a3
remove useless blank template
2014-11-03 11:16:48 +11:00
Sebastian McKenzie
93c6d69e21
make transformation tests ignore whitespace
2014-11-03 11:15:06 +11:00
Sebastian McKenzie
57d3c836bd
register: add additional blacklistTests
2014-11-03 11:14:52 +11:00
Sebastian McKenzie
115282d57b
generator: add _push method to simplify buffer pushing and location tracking
2014-11-03 11:13:37 +11:00
Sebastian McKenzie
72d924d85b
generator: fix NewExpression arguments
2014-11-03 11:12:30 +11:00
Sebastian McKenzie
6838062279
move util.errorWithNode to File
2014-11-03 11:11:37 +11:00
Sebastian McKenzie
bc79cec15a
add NewExpression support to needsParans
2014-11-03 11:11:07 +11:00
Sebastian McKenzie
85f0f6fb14
add whitespace option and move util.errorWithNode to File
2014-11-03 11:09:58 +11:00
amsul
ddbb522392
Updated blacklist option to replace reference
2014-11-01 19:36:10 -04:00
amsul
288cfd1f00
Added ability to register 6to5 with a blacklist
...
Currently, to achieve this, I have to use this workaround:
```js
var to5 = require('6to5')
delete to5.transform.transformers.generators
require('6to5/register')
```
After this simple change, I can make it much nicer:
```js
require('6to5/register')({
blacklist: ['generators']
})
```
Cheers!
2014-11-01 14:15:52 -04:00
Sebastian McKenzie
435b9434ea
don't mess with the indentation of TemplateElements
2014-11-01 23:26:48 +11:00
Sebastian McKenzie
2409b017db
generator: remove parans around ConditionalExpression
2014-11-01 23:08:50 +11:00
Sebastian McKenzie
99f2864048
generator: remove redundant print call
2014-11-01 23:08:33 +11:00
Sebastian McKenzie
5351057557
generator: move BlockStatement to base generator
2014-11-01 23:08:16 +11:00
Sebastian McKenzie
1a5ee7d5da
change acorn-jsx to acorn-6to5
2014-11-01 23:07:53 +11:00
Sebastian McKenzie
ebea86c527
split up types.ensureBlock into types.toBlock
2014-11-01 23:07:34 +11:00
Sebastian McKenzie
bf58004947
generator: add intelligent whitespace based on tokens on nodes in a sequence
2014-11-01 23:07:17 +11:00
Sebastian McKenzie
f0c78102ca
move template literal generators into separate file
2014-11-01 19:37:21 +11:00
Sebastian McKenzie
43ea593677
traverse.removeProperties: remove raw property
2014-11-01 19:29:17 +11:00
Sebastian McKenzie
629cea497f
move keyword method and restyle variable declarations
2014-11-01 19:29:02 +11:00
Sebastian McKenzie
9475dc681f
finish jsx generator
2014-11-01 19:28:42 +11:00
Sebastian McKenzie
6e41309ede
add err.stack test to code frame error capture
2014-11-01 19:28:35 +11:00
Sebastian McKenzie
42322e1ce7
add examples to types.needsParans tests
2014-11-01 19:27:42 +11:00
Sebastian McKenzie
400fa8ed97
remove unused ParenthesizedExpression
2014-11-01 19:27:23 +11:00
Sebastian McKenzie
07e2842226
implement array comprehension generator
2014-11-01 19:27:09 +11:00
Sebastian McKenzie
7d46b7c465
expose generator
2014-11-01 17:56:07 +11:00
Sebastian McKenzie
fcf6c9e066
generator: add isLast helper method
2014-11-01 17:53:01 +11:00
Sebastian McKenzie
a5523664fc
generator: add alternate support to IfStatement
2014-11-01 17:52:48 +11:00
Sebastian McKenzie
33f8988313
support for numeric literals with recast - fixes #117
2014-11-01 16:06:46 +11:00
Sebastian McKenzie
1d3544eadc
fix function generation spacing
2014-11-01 16:00:17 +11:00
Sebastian McKenzie
646bdfd04c
types.needsParans: add parent ExpressionStatement check for FunctionExpression
2014-11-01 15:58:44 +11:00
Sebastian McKenzie
aba9bba7db
generator: use new keyword method for keywords
2014-11-01 15:56:27 +11:00
Sebastian McKenzie
e77382582f
generator: add keyword method, remove __ident method and implement better position tracking
2014-11-01 15:56:10 +11:00
Sebastian McKenzie
bbffde374e
Merge branch 'master' into code-generator
2014-10-31 21:39:47 +11:00
Sebastian McKenzie
251e4d01c8
join together declarations in destructuring to return a single node if possible - fixes #113
2014-10-31 21:38:22 +11:00
Sebastian McKenzie
0fbf0e2a77
generator: add semicolon helper method, add optional printJoin iterator
2014-10-31 21:24:54 +11:00