Skip to content

Commit c756883

Browse files
committed
tests pass
1 parent 9768400 commit c756883

File tree

5 files changed

+15
-52
lines changed

5 files changed

+15
-52
lines changed

include/pyjs/pre_js/dynload/dynload.js

Lines changed: 13 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ function createLock() {
2020
// * global
2121
// * undefined // when we dont
2222
function libraryType (path) {
23-
console.log("check lib type for", path);
2423
if (path.includes("cpython-3") && path.includes("-wasm32-emscripten.so")) {
2524
return "local";
2625
}
@@ -40,58 +39,38 @@ async function loadDynlibsFromPackage(
4039
dynlibPaths,
4140
) {
4241

43-
44-
45-
// if(pkg_file_name == "zlib") {
46-
// console.log("zlib is always loaded, skipping loading from package");
47-
// return;
48-
// }
4942
if(prefix != "/")
5043
{
5144
throw `only root prefix / is supported for loading shared libraries from packages, got: ${prefix}`;
5245
}
5346

54-
console.log("LAPALUZA");
55-
5647
// console.log("load shared objects from package:", pkg_file_name, dynlibPaths);
5748
for (let i = 0; i < dynlibPaths.length; i++) {
5849
let path = dynlibPaths[i];
5950

60-
// // if the name contains "_tests" we skip loading the shared libraries
61-
// if (path.includes("_tests") || path.includes("_simd")) {
62-
// console.log(`skipping loading shared libraries from package ${pkg_file_name} because it is a test package or simd package`);
63-
// continue;
64-
// }
65-
6651
const isSymlink = FS.isLink(FS.lstat(path));
6752
if (isSymlink) {
68-
console.log(`skipping symlinked shared library ${path} from package ${pkg_file_name}`);
6953
continue;
7054
}
7155

7256
const releaseDynlibLock = await _lock();
7357
try {
7458

75-
//#define RTLD_LAZY 1
76-
// #define RTLD_NOW 2
77-
// #define RTLD_NOLOAD 4
78-
// #define RTLD_NODELETE 4096
79-
// #define RTLD_GLOBAL 256
80-
// #define RTLD_LOCAL 0
59+
// RTLD_LAZY 1
60+
// RTLD_NOW 2
61+
// RTLD_NOLOAD 4
62+
// RTLD_NODELETE 4096
63+
// RTLD_GLOBAL 256
64+
// RTLD_LOCAL 0
8165

8266
const libt = libraryType(path);
8367
let flag = 2; // RTLD_NOW
84-
// if(libt === "local"){
85-
// console.log(`loading local shared library ${path} from package ${pkg_file_name}`);
86-
// flag = 2 /* RTLD_NOW */ | 0 /* RTLD_LOCAL */;
87-
// }
88-
// else if(libt === "global"){
89-
// console.log(`loading global shared library ${path} from package ${pkg_file_name}`);
90-
// flag = 2 /* RTLD_NOW */ | 256 /* RTLD_GLOBAL */;
91-
// }
92-
// else{
93-
// console.log(`loading shared library ${path} from package ${pkg_file_name} with default flags`);
94-
// }
68+
if(libt === "local"){
69+
flag = 2 /* RTLD_NOW */ | 0 /* RTLD_LOCAL */;
70+
}
71+
else if(libt === "global"){
72+
flag = 2 /* RTLD_NOW */ | 256 /* RTLD_GLOBAL */;
73+
}
9574

9675
const stack = Module.stackSave();
9776
const pathUTF8 = Module.stringToUTF8OnStack(path);
@@ -129,15 +108,7 @@ async function loadDynlibsFromPackage(
129108

130109
}
131110

132-
if(libt !== "local"){
133-
console.log('re-register shared library with filename without path');
134-
// get filename from path
135-
const filename = getFilenameFromPath(path);
136-
console.log(`registering shared library ${path} from package ${pkg_file_name} as ${filename} in global namespace`);
137-
// Module.LDSO.loadedLibsByName[filename] = Module.LDSO.loadedLibsByName[path];
138-
139-
}
140-
console.log(`!!!!!!!!!shared library ${path} from package ${pkg_file_name} is ready`);
111+
141112
} catch (e) {
142113
throw e;
143114
} finally {

include/pyjs/pre_js/init.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ Module['init_phase_1'] = async function(prefix, python_version, verbose) {
156156

157157
Module['pyobject'].prototype.get = function(...keys) {
158158

159-
160159
let types = keys.map(Module['_get_type_string'])
161-
console.log("getitem keys", keys, types);
162160
let ret = this._raw_getitem(keys, types, keys.length)
163161
if (ret.has_err) {
164162
throw ret

src/export_py_object.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ namespace pyjs
8888

8989

9090
// implicit to py
91-
92-
std::cout<<"getitem n_keys "<<n_keys<<std::endl;
93-
9491
py::list py_args;
9592
for (std::size_t i = 0; i < n_keys; ++i)
9693
{

src/js_timestamp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define PYJS_JS_UTC_TIMESTAMP "2025-10-07 08:54:42.780758"
1+
#define PYJS_JS_UTC_TIMESTAMP "2025-10-07 09:33:27.627626"

tests/atests/async_tests.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ async def test_callbacks_in_async_2():
3737
async_js_function = pyjs.js.Function(
3838
"""
3939
return async function(py_dict){
40-
console.log('call py: ')
41-
const val = py_dict.get('value')
42-
console.log('got value:', val)
43-
return val
40+
return py_dict.get('value')
4441
}
4542
"""
4643
)()

0 commit comments

Comments
 (0)