edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] radiocaroline.. regex in control structures
@ 2017-10-02  7:30 Kevin Carhart
  0 siblings, 0 replies; only message in thread
From: Kevin Carhart @ 2017-10-02  7:30 UTC (permalink / raw)
  To: edbrowse-dev



I pursued two more runtimes in radiocaroline:

Similar to requiring Canvas, it wants element types called Audio and 
AudioContext.  They are first referenced in a js file called amplitude, 
which is 
document.scripts[5].  I made stubs for these, just like Canvas, so that it 
would continue running.


What happened next was a strange parse error in lines such as:
         for (var d = document.getElementsByClassName('amplitude-play'), e 
= 0; e < d.length; e++)
             /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera 
Mini/i.test(navigator.userAgent) ? (d[e].removeEventListener('touchstart', 
t), d[e].addEventListener('touchstart', t)) : 
(d[e].removeEventListener('click', t), d[e].addEventListener('click', t));


I simplified this expression to find out how simple I could make it and 
still get an error.  A lot of the junk above is not needed.  The 
error is still raised by a simple case.  Consider the difference between 
these two:

if (1==1) /blah/.test("blah")
jdb line 1: SyntaxError: parse error
if (1==1) { /blah/.test("blah") }
true

Apparently duktape does not like for the opening slash of regexp syntax to 
be the first character of a one-liner control-structure body.
Any ideas, short of asking SV?
Or maybe I am misdiagnosing and you notice something I am not?

thanks
Kevin

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-02  7:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-02  7:30 [Edbrowse-dev] radiocaroline.. regex in control structures Kevin Carhart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).