Comments (9)
just noticed there is more than the initial error.
will fix more tomorrow. goal is to get all of these bugs away + fs functions built till end of the coming weekend
from lowjs.
Update: Babel 6 generated code works, but this Babel 7 code does not.
from lowjs.
After replacing the Babel 7 class code with Babel 6 code I got past the above error (which still stands though, I think we really need a solution for Babel 7) I ran into a problem with the Map
polyfill, which I think (without having investigated deeply) does not work well with the Babel 7 generated code using it.
The output starts with two lines from console.log
statements I inserted just before the given location.
mha@mint-virtual-machine ~/neo/DEVICE $ ~/lowjs-linux-x86_64-20181212/bin/low index.js
1 { next: [Function] }
1 undefined
TypeError: undefined not callable (property [Symbol wellknown '?Symbol.iterator?'] of [object Object])
at [anon] (deps/duktape/src-low/duktape.c:64945) internal
at informSubscribers (/home/mha/neo/DEVICE/node_modules/one/lib/version-map-updater.js:80) strict
at _callee$ (/home/mha/neo/DEVICE/node_modules/one/lib/version-map-updater.js:162) strict
at tryCatch (/home/mha/neo/node_modules/regenerator-runtime/runtime.js:62) strict
at invoke (/home/mha/neo/node_modules/regenerator-runtime/runtime.js:296) strict tailcall
at asyncGeneratorStep (/home/mha/neo/DEVICE/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3)
at _next (/home/mha/neo/DEVICE/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25)
at invokeCallback (lib:init:311) strict
at publish (lib:init:381) strict
at publishFulfillment (lib:init:386) strict
at asyncFlush (lib:init:276) strict preventsyield
[...]Error
The code at the location, including the console.log
statements — line 80 is the for
statements;
console.log(1, subscriptions.entries());
console.log(1, subscriptions.entries()[Symbol.iterator]);
try {
for (var _iterator = subscriptions.entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
...
from lowjs.
NOW RUNNING ON THE DEVICE (using lowsync
)
var TEST_RECIPE_RULE_PROPERTIES = (function () {
var a = [1,2,3,4,5,6,7,8,9].map(function (o) {
var e = ['s1', 's2'];
console.log(10, 'Adding to Map:', e);
return e;
});
console.log(11, a);
var m = new Map(a);
return m;
})();
Output:
[1:48:17 PM] 10 'Adding to Map:' [ 's1', 's2' ]
[1:48:17 PM] 10 'Adding to Map:' [ 's1', 's2' ]
[1:48:17 PM] 10 'Adding to Map:' [ 's1', 's2' ]
[1:48:17 PM] 10 'Adding to Map:' [ 's1', 's2' ]
[1:48:17 PM] 10 'Adding to Map:' [ 's1', 's2' ]
[1:48:17 PM] 10 'Adding to Map:' [ 's1', 's2' ]
[1:48:17 PM] 10 'Adding to Map:' [ 's1', 's2' ]
[1:48:17 PM] 10 'Adding to Map:' [ 's1', 's2' ]
[1:48:18 PM] 10 'Adding to Map:' [ 's1', 's2' ]
[1:48:18 PM] 11 [ undefined,
[1:48:18 PM] undefined,
[1:48:18 PM] undefined,
[1:48:18 PM] undefined,
[1:48:18 PM] undefined,
[1:48:18 PM] undefined,
[1:48:18 PM] undefined,
[1:48:18 PM] undefined,
[1:48:18 PM] undefined ]
If I remove the console.log
statement that outputs the 'Adding to Map:' lines the output of console.log(11, a);
becomes [ 's2', 's2', 's2', 's2', 's2', 's2', 's2', 's2', 's2' ]
when it should be an array of 9 times [ 's1', 's2' ]
, or at the very least it should not change from the previous error of getting an array of undefined
).
I would really like to see the code Babel generates here, it seems to be completely off.
This is why I would prefer to Babel the code myself and send it to the device with transpilation disabled. At least I'll know what the code looks like and can use the line numbers from stack traces.
from lowjs.
Regarding the TypeError: undefined not callable (property [Symbol wellknown '?Symbol.iterator?'] of [object Object]) problem:
It seems like the code is calling Symbol.iterator on a map iterator. So creating an iterator of an iterator.
This actually works in node:
new Map()Symbol.iteratorSymbol.iteratorSymbol.iteratorSymbol.iteratorSymbol.iterator
is valid.
Would like to update low.js so this also works here. Right now only an iterator of a map can be created. But what is an iterator of an iterator of a map? Is it just a copy of the iterator, pointing to the same position the original iterator is also in? Cannot find anything about this online. Any idea?
Regarding the second problem with the console.log(10, 'Adding to Map:', e); :
This code is valid ES5.1, and runs with low.js on PC directly. Babel transform does not change it. And it runs through.
So weird that the behaviour on the board is supposedly different. Will try out tomorrow.
from lowjs.
Babel bug?
To two, yes it runs on low.js, the issue only occurred when I transferred it to the device.
from lowjs.
I cannot reproduce your problem. Here, both with the console.log and without the output is:
[01:03:35] 11 [ [ 's1', 's2' ],
[01:03:35] [ 's1', 's2' ],
[01:03:35] [ 's1', 's2' ],
[01:03:35] [ 's1', 's2' ],
[01:03:35] [ 's1', 's2' ],
[01:03:35] [ 's1', 's2' ],
[01:03:35] [ 's1', 's2' ],
[01:03:35] [ 's1', 's2' ],
[01:03:35] [ 's1', 's2' ] ]
... can you retry?
from lowjs.
Update: It's on my TODO list, as soon as I can get the device working again...
from lowjs.
This seems to be still happening with the latest version
unhandledRejection Error: unsupported
at [anon] (deps/duktape/src-low/duktape.c:41429) internal
at get () native strict preventsyield
at _get (/mnt/d/WebstormProjects/Valetudo_Github/dist/index.js:1) strict
at parseStatus (/mnt/d/WebstormProjects/Valetudo_Github/dist/index.js:4050) strict
at updateStatus (/mnt/d/WebstormProjects/Valetudo_Github/dist/index.js:2275) strict
The relevant code fragment in line 4050 looks like this:
_get(_getPrototypeOf(RoborockS5.prototype),"parseStatus",this).call(this,res);
from lowjs.
Related Issues (20)
- Can not use Socket from net module. HOT 2
- www.lowjs.org is down HOT 1
- make error on build HOT 2
- MQTT pub issue HOT 6
- Unexpected error: Cannot find module 'invariant' HOT 1
- SyntaxError: unterminated statement (line 7) HOT 2
- M5Stack button pin not available HOT 2
- ESP32-WROVER unable to connect to wifi network on pro firmware
- HowTo read adc input voltage with lowjs HOT 1
- How to build lowjs from sources... HOT 1
- spi uses the device to disconnect
- Cannot use spi to receive data
- low.js dead ? HOT 1
- An unhandled exception occurred: Cannot find module '../lib/statuses'
- Tổ hợp Sun Riverpolis Đà Nẵng
- java job
- Typo: _trasformNeeded
- Is class a supported construct? I am getting following error HOT 1
- Website not working HOT 2
- ESP32 Code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lowjs.