edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Kevin Carhart <kevin@carhart.net>
To: edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] radiocaroline.. regex in control structures
Date: Mon, 2 Oct 2017 00:30:11 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LRH.2.03.1710020009170.16896@carhart.net> (raw)



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

                 reply	other threads:[~2017-10-02  7:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LRH.2.03.1710020009170.16896@carhart.net \
    --to=kevin@carhart.net \
    --cc=edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).