Uncaught TypeError: Prototype should be an object, got Function #1601
Replies: 5 comments
-
Posted at 2022-01-14 by @gfwilliams Please can you come up with a very minimal code example that works on its own that I can use to test with? It's possible it's just an overzealous check |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-01-16 by gdanov The piece of code below reproduces the error. The weird part is that if you comment out the line where proto is assigned in one (regardless which) of the two constructors you don't get the error. This does not make sense to me.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-01-19 by @gfwilliams It's just a check in the interpreter when proto is assigned (because it's an internal variable). Just fixed it - so latest builds will work now |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-01-21 by gdanov Using espruino_2v11.30_esp32.bin this error is gone. Thanks! In case you are wondering — I'm trying to upload the immutable.js library as sort of stress test. Want to see if it's feasible to use most of my regular JS toolbox. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-01-24 by @gfwilliams Oh, you're on ESP32? I'm not sure if it uses all 4M by default - you'd have to ask on the ESP32 section of the forum, but...
Realistically, I think the answer here is 'no'. Espruino's really not set up for this kind of thing - I mean, it may be possible but trying to use a desktop library on an embedded device with Espruino is going to be very painful, and won't be performant. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-01-13 by gdanov
I'm getting the error in the subject. The code is
and yes, Collection is function. But also an Object.
Do I need to transpile this or something else?
Beta Was this translation helpful? Give feedback.
All reactions