BertrandBev / eigen-js

⚡ Eigen-js is a port of the Eigen C++ linear algebra library
https://bertrandbev.github.io/eigen-js/#/
92 stars 15 forks source link

index.js got an error #50

Closed try-to-be-brave closed 1 year ago

try-to-be-brave commented 1 year ago

I used Emscripten compiled eigen_gen.js and eigen_gen.wasm to build the index.js of this project.

But when I run test.mjs I get an error of "TypeError: Cannot read properties of undefined (reading 'prototype')at Function.initClass(....\dist\index.js:1:1001402)"

The code snippet in index.js is: var Q=g(1),B=g(2),C=g(3);function E(A){return Object.getOwnPropertyNames(A).filter(I=>"constructor"!==I&&"function"==typeof A[I])}class D{static add(...A){A.flat(1/0).forEach(A=>{D.objects.add(A)})}static pushException(...A){A.flat(1/0).forEach(A=>{const I=D.whitelist.get(A)||0;D.whitelist.set(A,I+1)})}static popException(...A){A.flat(1/0).forEach(A=>{const I=D.whitelist.get(A)||0;D.whitelist.set(A,I-1),D.whitelist.get(A)<=0&&D.whitelist.remove(A)})}static flush(){const A=[...D.objects].filter(A=>!D.whitelist.has(A));return A.forEach(A=>{A.delete(),D.objects.delete(A)}),A.length}static set(A,I,g){A[I]&&D.popException(A[I]),D.pushException(g),A[I]=g}static initClass(A,I){const g=function(...A){const g=new I(...A);return D.add(g),g},Q=[I,I.prototype];

This is driving me crazy. Can you give me an index.js that you compiled。

BertrandBev commented 1 year ago

After compiling compiled eigen_gen.js and eigen_gen.wasm, you should be able to run yarn build. Did you try that? I added the built index.js to the repo by the way