Fix breakages when upgrading to babel 6
Reviewed By: vjeux Differential Revision: D2628092 fb-gh-sync-id: 077a3572fe8b261d390be2bdc32d9d06c2b80a01
This commit is contained in:
parent
6eec446106
commit
b907f40957
|
@ -11,7 +11,7 @@
|
||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var bezier = require('bezier');
|
var _bezier = require('bezier');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class implements common easing functions. The math is pretty obscure,
|
* This class implements common easing functions. The math is pretty obscure,
|
||||||
|
@ -114,7 +114,7 @@ class Easing {
|
||||||
epsilon = (1000 / 60 / duration) / 4;
|
epsilon = (1000 / 60 / duration) / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bezier(x1, y1, x2, y2, epsilon);
|
return _bezier(x1, y1, x2, y2, epsilon);
|
||||||
}
|
}
|
||||||
|
|
||||||
static in(
|
static in(
|
||||||
|
|
|
@ -8,12 +8,10 @@
|
||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
jest
|
jest.autoMockOff();
|
||||||
.dontMock('../saveBundleAndMap')
|
|
||||||
.dontMock('os-tmpdir')
|
|
||||||
.dontMock('temp');
|
|
||||||
|
|
||||||
jest.mock('fs');
|
jest.mock('fs');
|
||||||
|
jest.mock('../sign');
|
||||||
|
|
||||||
const saveBundleAndMap = require('../saveBundleAndMap');
|
const saveBundleAndMap = require('../saveBundleAndMap');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
|
@ -140,7 +140,8 @@ class Bundler {
|
||||||
dev: isDev,
|
dev: isDev,
|
||||||
platform,
|
platform,
|
||||||
}) {
|
}) {
|
||||||
const bundle = new Bundle(sourceMapUrl);
|
// Const cannot have the same name as the method (babel/babel#2834)
|
||||||
|
const bbundle = new Bundle(sourceMapUrl);
|
||||||
const findEventId = Activity.startEvent('find dependencies');
|
const findEventId = Activity.startEvent('find dependencies');
|
||||||
let transformEventId;
|
let transformEventId;
|
||||||
|
|
||||||
|
@ -158,11 +159,11 @@ class Bundler {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bundle.setMainModuleId(response.mainModuleId);
|
bbundle.setMainModuleId(response.mainModuleId);
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
response.dependencies.map(
|
response.dependencies.map(
|
||||||
module => this._transformModule(
|
module => this._transformModule(
|
||||||
bundle,
|
bbundle,
|
||||||
response,
|
response,
|
||||||
module,
|
module,
|
||||||
platform
|
platform
|
||||||
|
@ -178,11 +179,11 @@ class Bundler {
|
||||||
Activity.endEvent(transformEventId);
|
Activity.endEvent(transformEventId);
|
||||||
|
|
||||||
transformedModules.forEach(function(moduleTransport) {
|
transformedModules.forEach(function(moduleTransport) {
|
||||||
bundle.addModule(moduleTransport);
|
bbundle.addModule(moduleTransport);
|
||||||
});
|
});
|
||||||
|
|
||||||
bundle.finalize({runBeforeMainModule, runMainModule});
|
bbundle.finalize({runBeforeMainModule, runMainModule});
|
||||||
return bundle;
|
return bbundle;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,21 +16,18 @@ jest
|
||||||
.dontMock('../../lib/getCacheFilePath');
|
.dontMock('../../lib/getCacheFilePath');
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.mock('os')
|
.mock('fs')
|
||||||
.mock('fs');
|
.setMock('os', {
|
||||||
|
tmpDir() { return 'tmpDir'; }
|
||||||
|
});
|
||||||
|
|
||||||
var Promise = require('promise');
|
var Promise = require('promise');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var os = require('os');
|
|
||||||
var _ = require('underscore');
|
var _ = require('underscore');
|
||||||
|
|
||||||
var Cache = require('../');
|
var Cache = require('../');
|
||||||
|
|
||||||
describe('JSTransformer Cache', () => {
|
describe('JSTransformer Cache', () => {
|
||||||
beforeEach(() => {
|
|
||||||
os.tmpDir.mockImpl(() => 'tmpDir');
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('getting/setting', () => {
|
describe('getting/setting', () => {
|
||||||
pit('calls loader callback for uncached file', () => {
|
pit('calls loader callback for uncached file', () => {
|
||||||
fs.stat.mockImpl((file, callback) => {
|
fs.stat.mockImpl((file, callback) => {
|
||||||
|
|
|
@ -46,9 +46,9 @@ describe('System.import', () => {
|
||||||
|
|
||||||
function transform(source) {
|
function transform(source) {
|
||||||
return babel.transform(source, {
|
return babel.transform(source, {
|
||||||
plugins: [require('../')],
|
plugins: [
|
||||||
blacklist: ['strict'],
|
[require('../'), { bundlesLayout: layout }]
|
||||||
extra: { bundlesLayout: layout },
|
],
|
||||||
}).code;
|
}).code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ function transform(src, filename, options) {
|
||||||
'transform-flow-strip-types',
|
'transform-flow-strip-types',
|
||||||
'transform-object-assign',
|
'transform-object-assign',
|
||||||
'transform-object-rest-spread',
|
'transform-object-rest-spread',
|
||||||
|
'transform-object-assign',
|
||||||
'transform-react-display-name',
|
'transform-react-display-name',
|
||||||
'transform-react-jsx',
|
'transform-react-jsx',
|
||||||
'transform-regenerator',
|
'transform-regenerator',
|
||||||
|
|
Loading…
Reference in New Issue