mirror of https://github.com/status-im/metro.git
rebase
This commit is contained in:
parent
ef2a4f99e2
commit
ae0c45e82c
|
@ -4,7 +4,11 @@
|
|||
"description": "",
|
||||
"main": "index.js",
|
||||
"jest": {
|
||||
"unmockedModulePathPatterns": ["source-map"],
|
||||
"testPathIgnorePatterns": ["JSAppServer/node_modules"]
|
||||
"unmockedModulePathPatterns": [
|
||||
"source-map"
|
||||
],
|
||||
"testPathIgnorePatterns": [
|
||||
"JSAppServer/node_modules"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,18 +16,26 @@ var staticTypeSyntax =
|
|||
var visitorList = reactVisitors;
|
||||
|
||||
|
||||
function transform(transformSets, srcTxt, options) {
|
||||
options = options || {};
|
||||
function transform(transformSets, srcTxt) {
|
||||
var options = {
|
||||
es3: true,
|
||||
sourceType: 'nonStrictModule'
|
||||
};
|
||||
|
||||
// These tranforms mostly just erase type annotations and static typing
|
||||
// related statements, but they were conflicting with other tranforms.
|
||||
// Running them first solves that problem
|
||||
var staticTypeSyntaxResult = jstransform(
|
||||
staticTypeSyntax,
|
||||
srcTxt
|
||||
srcTxt,
|
||||
options
|
||||
);
|
||||
|
||||
return jstransform(visitorList, staticTypeSyntaxResult.code);
|
||||
return jstransform(
|
||||
visitorList,
|
||||
staticTypeSyntaxResult.code,
|
||||
options
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = function(data, callback) {
|
||||
|
@ -35,8 +43,7 @@ module.exports = function(data, callback) {
|
|||
try {
|
||||
result = transform(
|
||||
data.transformSets,
|
||||
data.sourceCode,
|
||||
data.options
|
||||
data.sourceCode
|
||||
);
|
||||
} catch (e) {
|
||||
return callback(null, {
|
||||
|
|
Loading…
Reference in New Issue