in es5 bablify the original code, not just the prepacked result

Summary:
Not sure why I didn't do it this way in the first place. Instead of applying babel to the prepacked code, apply it to them input source code. Make it an apples to apples comparison
Closes https://github.com/facebook/prepack/pull/1166

Differential Revision: D6360177

Pulled By: simonhj

fbshipit-source-id: 9c9a137178d54a36dc146e18c47b161426f09b5c
This commit is contained in:
Simon Jensen 2017-12-04 20:40:23 -08:00 committed by Facebook Github Bot
parent 994daf7924
commit e808587c88

View File

@ -380,6 +380,9 @@ function runTest(name, code, options, args) {
let i = code.indexOf(injectAtRuntime);
addedCode = code.substring(i + injectAtRuntime.length, code.indexOf("\n", i));
}
if (args.es5) {
code = transformWithBabel(code, [], [["env", { forceAllTransforms: true, modules: false }]]);
}
let unique = 27277;
let oldUniqueSuffix = "";
let expectedCode = code;