@lynx-js/testing-environment 0.1.1 → 0.1.2
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.js +3 -3
- package/dist/lynx/ElementPAPI.cjs +6 -3
- package/dist/lynx/ElementPAPI.js +6 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import events from "events";
|
|
2
2
|
import { createGlobalThis } from "./lynx/GlobalThis.js";
|
|
3
3
|
import { initElementTree } from "./lynx/ElementPAPI.js";
|
|
4
4
|
function _define_property(obj, key, value) {
|
|
@@ -74,7 +74,7 @@ function createPolyfills() {
|
|
|
74
74
|
]);
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
const ee = new
|
|
77
|
+
const ee = new events();
|
|
78
78
|
ee.dispatchEvent = ({ type, data })=>{
|
|
79
79
|
const isMainThread = __MAIN_THREAD__;
|
|
80
80
|
lynxTestingEnv.switchToBackgroundThread();
|
|
@@ -181,7 +181,7 @@ function injectBackgroundThreadGlobals(target, polyfills) {
|
|
|
181
181
|
updateData: {}
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
|
-
const globalEventEmitter = new
|
|
184
|
+
const globalEventEmitter = new events();
|
|
185
185
|
globalEventEmitter.trigger = globalEventEmitter.emit;
|
|
186
186
|
globalEventEmitter.toggle = globalEventEmitter.emit;
|
|
187
187
|
target.lynx = {
|
|
@@ -178,9 +178,12 @@ const initElementTree = ()=>{
|
|
|
178
178
|
}
|
|
179
179
|
__RemoveElement(parent, child) {
|
|
180
180
|
let ch = parent.firstChild;
|
|
181
|
-
while(ch)
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
while(ch){
|
|
182
|
+
if (ch === child) {
|
|
183
|
+
parent.removeChild(ch);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
ch = ch.nextSibling;
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
189
|
__InsertElementBefore(parent, child, ref) {
|
package/dist/lynx/ElementPAPI.js
CHANGED
|
@@ -150,9 +150,12 @@ const initElementTree = ()=>{
|
|
|
150
150
|
}
|
|
151
151
|
__RemoveElement(parent, child) {
|
|
152
152
|
let ch = parent.firstChild;
|
|
153
|
-
while(ch)
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
while(ch){
|
|
154
|
+
if (ch === child) {
|
|
155
|
+
parent.removeChild(ch);
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
ch = ch.nextSibling;
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
__InsertElementBefore(parent, child, ref) {
|