@lynx-js/testing-environment 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -6
- package/dist/index.js +8 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -116,21 +116,23 @@ function createPolyfills() {
|
|
|
116
116
|
};
|
|
117
117
|
const ee = new (external_events_default())();
|
|
118
118
|
ee.dispatchEvent = ({ type, data })=>{
|
|
119
|
-
const
|
|
120
|
-
lynxTestingEnv.switchToBackgroundThread();
|
|
119
|
+
const origin = __MAIN_THREAD__ ? 'CoreContext' : 'JSContext';
|
|
120
|
+
if ('CoreContext' === origin) lynxTestingEnv.switchToBackgroundThread();
|
|
121
|
+
else lynxTestingEnv.switchToMainThread();
|
|
121
122
|
ee.emit(type, {
|
|
122
|
-
data: data
|
|
123
|
+
data: data,
|
|
124
|
+
origin
|
|
123
125
|
});
|
|
124
|
-
if (
|
|
126
|
+
if ('CoreContext' === origin) lynxTestingEnv.switchToMainThread();
|
|
127
|
+
else lynxTestingEnv.switchToBackgroundThread();
|
|
125
128
|
};
|
|
126
129
|
ee.addEventListener = ee.addListener;
|
|
127
130
|
ee.removeEventListener = ee.removeListener;
|
|
128
131
|
const CoreContext = ee;
|
|
129
132
|
const JsContext = ee;
|
|
130
|
-
function __LoadLepusChunk(chunkName,
|
|
133
|
+
function __LoadLepusChunk(chunkName, _options) {
|
|
131
134
|
const isBackground = !__MAIN_THREAD__;
|
|
132
135
|
globalThis.lynxTestingEnv.switchToMainThread();
|
|
133
|
-
if (process.env['DEBUG']) console.log('__LoadLepusChunk', chunkName, options);
|
|
134
136
|
let ans;
|
|
135
137
|
if ('worklet-runtime' === chunkName) {
|
|
136
138
|
var _globalThis_onInitWorkletRuntime, _globalThis;
|
package/dist/index.js
CHANGED
|
@@ -77,21 +77,23 @@ function createPolyfills() {
|
|
|
77
77
|
};
|
|
78
78
|
const ee = new events();
|
|
79
79
|
ee.dispatchEvent = ({ type, data })=>{
|
|
80
|
-
const
|
|
81
|
-
lynxTestingEnv.switchToBackgroundThread();
|
|
80
|
+
const origin = __MAIN_THREAD__ ? 'CoreContext' : 'JSContext';
|
|
81
|
+
if ('CoreContext' === origin) lynxTestingEnv.switchToBackgroundThread();
|
|
82
|
+
else lynxTestingEnv.switchToMainThread();
|
|
82
83
|
ee.emit(type, {
|
|
83
|
-
data: data
|
|
84
|
+
data: data,
|
|
85
|
+
origin
|
|
84
86
|
});
|
|
85
|
-
if (
|
|
87
|
+
if ('CoreContext' === origin) lynxTestingEnv.switchToMainThread();
|
|
88
|
+
else lynxTestingEnv.switchToBackgroundThread();
|
|
86
89
|
};
|
|
87
90
|
ee.addEventListener = ee.addListener;
|
|
88
91
|
ee.removeEventListener = ee.removeListener;
|
|
89
92
|
const CoreContext = ee;
|
|
90
93
|
const JsContext = ee;
|
|
91
|
-
function __LoadLepusChunk(chunkName,
|
|
94
|
+
function __LoadLepusChunk(chunkName, _options) {
|
|
92
95
|
const isBackground = !__MAIN_THREAD__;
|
|
93
96
|
globalThis.lynxTestingEnv.switchToMainThread();
|
|
94
|
-
if (process.env['DEBUG']) console.log('__LoadLepusChunk', chunkName, options);
|
|
95
97
|
let ans;
|
|
96
98
|
if ('worklet-runtime' === chunkName) {
|
|
97
99
|
var _globalThis_onInitWorkletRuntime, _globalThis;
|