mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove experimental support for Hermes Modules (CommonJS)
Summary: Changelog: [Internal] Reviewed By: jacdebug Differential Revision: D41736222 fbshipit-source-id: 05c03ff31072416f7ee81baccb8a4efd2c8baa85
This commit is contained in:
committed by
Facebook GitHub Bot
parent
006527fea7
commit
340c046c2e
@@ -11,7 +11,6 @@
|
||||
'use strict';
|
||||
|
||||
export type FetchSegmentFunction = typeof __fetchSegment;
|
||||
export type GetSegmentFunction = typeof __getSegment;
|
||||
|
||||
/**
|
||||
* Set up SegmentFetcher.
|
||||
@@ -51,43 +50,3 @@ function __fetchSegment(
|
||||
}
|
||||
|
||||
global.__fetchSegment = __fetchSegment;
|
||||
|
||||
function __getSegment(
|
||||
segmentId: number,
|
||||
options: $ReadOnly<{
|
||||
otaBuildNumber: ?string,
|
||||
requestedModuleName: string,
|
||||
segmentHash: string,
|
||||
}>,
|
||||
callback: (?Error, ?string) => void,
|
||||
) {
|
||||
const SegmentFetcher =
|
||||
require('./SegmentFetcher/NativeSegmentFetcher').default;
|
||||
|
||||
if (!SegmentFetcher.getSegment) {
|
||||
throw new Error('SegmentFetcher.getSegment must be defined');
|
||||
}
|
||||
|
||||
SegmentFetcher.getSegment(
|
||||
segmentId,
|
||||
options,
|
||||
(
|
||||
errorObject: ?{
|
||||
message: string,
|
||||
code: string,
|
||||
...
|
||||
},
|
||||
path: ?string,
|
||||
) => {
|
||||
if (errorObject) {
|
||||
const error = new Error(errorObject.message);
|
||||
(error: any).code = errorObject.code; // flowlint-line unclear-type: off
|
||||
callback(error);
|
||||
}
|
||||
|
||||
callback(null, path);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
global.__getSegment = __getSegment;
|
||||
|
||||
Reference in New Issue
Block a user