Closed
Description
postamble.js adds Module.then
when -s MODULARIZE=1
but using it causes indefinite loop on Promise.resolve()
and ES2017 await
statement.
By the spec the resolving strategy is greedy: if an object has then
method then it will be called with two function arguments including resolver and rejector. If the resolver is called with an object with a then
method it will be called again with two function arguments, and then again, again.
Module.then
resolves with Module
which still has then
, so the await
statement loops indefinitely.
PS: Fixed some wrong concepts.