[Pas2js] sequencing function calls in pas2js
warleyalex
warleyalex at yahoo.com.br
Sat Jun 9 15:08:16 CEST 2018
I added the definition "function bind(aValue: JSValue; aData: JSValue):
JSValue;" into the JPromise class scope and I did a quick test in
SMS/DWScript compiler
--------------------------------------------------
queue
.&then(JPromise(@doTask).bind(nil, 'teste'))
.&then(@_doTask0)
.&then(@_doTask1)
.&then(@_doTask2)
.&then(@_doTask3);
--------------------------------------------------
and it's working as expected, the compiler emit:
Promise.resolve().then(doTask.bind(null,"teste")).then(_doTask0).then(_doTask1).then(_doTask2).then(_doTask3);
The same code in pas2js, the compiler does not comply with the syntax
umain.pas(1218,25) Error: Illegal type conversion: "function type" to "class
JPromise"
------------------------------------------------
queue
.&then(JPromise(@doTask).bind(nil, 'teste'))
.&then(@_doTask0)
.&then(@_doTask1)
.&then(@_doTask2)
.&then(@_doTask3);
------------------------------------------------
--
Sent from: http://pas2js.38893.n8.nabble.com/
More information about the Pas2js
mailing list