You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hostilefork
changed the title
JavaScript /AWAITER can only be called from rebPromise() inside script tag
Cannot use DUMP (--) debug facility without ReplPad Console
May 19, 2019
@gchiu - I'm assuming your intent here is to write to the JS console, since you're making your own page and not running from Replpad?
Because the -- is trying to write to the Replpad console, not the JavaScript console. (e.g. it is using WRITE-STDOUT). Because of the way things work, that has to be done inside of a reb.Promise().
But we might set up DUMP/-- to write to the JS console if it doesn't have a Rebol console available. Or maybe this could be configurable? It could be that it could use WRITE-STDLOG instead of WRITE-STDOUT...and then you could define whether you wanted the output to go to the JS console vs. the Rebol one?
-- is super useful, and one might want to use it even if one doesn't have the ReplPad loaded.
Practically speaking, even if they aren't console-based, the script snippets people will be wanting to write in <script> tags will likely look like code you would do from today's ReplPad. That means they'll be assuming they can read URLs or do other synchronous things.
If (2) is true, that means we have to be running the <script> code inside of a reb.Promise(), instead of how it's currently being done with reb.Elide().
I've gone ahead and done (2) ...just because it seems like odds are nothing too useful will come of Rebol code that isn't being called directly from JS that can't run awaiters.
HTML
Rebol
Gives error:
The text was updated successfully, but these errors were encountered: