[ReactNative] Enable resolveAssetSource for Image.android

This commit is contained in:
Alex Kotliarskyi 2015-04-24 10:56:58 -07:00
Родитель d094952725
Коммит 970bff6132
2 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -32,6 +32,12 @@ describe('resolveAssetSource', () => {
expect(resolveAssetSource(source2)).toBe(source2);
});
it('ignores any weird data', () => {
expect(resolveAssetSource(null)).toBe(null);
expect(resolveAssetSource(42)).toBe(null);
expect(resolveAssetSource('nonsense')).toBe(null);
});
describe('bundle was loaded from network', () => {
beforeEach(() => {
SourceCode.scriptURL = 'http://10.0.0.1:8081/main.bundle';

Просмотреть файл

@ -43,10 +43,11 @@ function pickScale(scales, deviceScale) {
return scales[scales.length - 1] || 1;
}
// TODO(frantic):
// * Pick best scale and append @Nx to file path
// * We are currently using httpServerLocation for both http and in-app bundle
function resolveAssetSource(source) {
if (!source || typeof source !== 'object') {
return null;
}
if (!source.__packager_asset) {
return source;
}