[react-native] Use trailing commas transform

Summary:
@public
Apparently trailing commas transform isn't exported by react-tools. We need to pull it out manually. This is not so clean but we're swtching to babel very shortly.

Test Plan:
* npm start
* write `foo(a,b,c,)` in some file
* request that file in the browser and make sure that trailing comma is gone
This commit is contained in:
Amjad Masad 2015-05-15 15:11:49 -07:00
parent 40da7bb835
commit d9b7e63e47
1 changed files with 4 additions and 2 deletions

View File

@ -16,10 +16,12 @@ var reactVisitors =
require('react-tools/vendor/fbtransform/visitors').getAllVisitors();
var staticTypeSyntax =
require('jstransform/visitors/type-syntax').visitorList;
var trailingCommaVisitors =
require('jstransform/visitors/es7-trailing-comma-visitors.js').visitorList;
// Note that reactVisitors now handles ES6 classes, rest parameters, arrow
// functions, template strings, and object short notation.
var visitorList = reactVisitors;
var visitorList = reactVisitors.concat(trailingCommaVisitors);
function transform(srcTxt, filename) {
var options = {