edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: edbrowse-dev@lists.the-brannons.com
Subject: [edbrowse-dev] 'this' in a breakpoint
Date: Wed, 05 Jun 2019 03:07:35 -0400	[thread overview]
Message-ID: <20190505030735.eklhad@comcast.net> (raw)
In-Reply-To: <alpine.DEB.2.21.1906042209080.211189@carhart.net>

[-- Attachment #1: Type: text/plain, Size: 779 bytes --]

Even if you could pass this to the eval function, and there are ways to do it, like eval.call(this,$bp), native eval seems to have no respect for this.
It doesn't inject this into the compilation of the string.
I fed this to the duktape shell and to the mozilla js shell.
You would expect to get 3 and 3, but we get 3 and then undefined.

t = {x:3, eval:eval, a:function(){print(this.x)}}; t.a(); t.eval("this.x");

Unless there is some other clever workaround, you'd have to say window.z=this,eval($bp)
and refer to z as needed, assuming z was not already a local variable, and remembering to delete z when done (cleaning up),
or var z = this; eval($bp); if the point of injection allows that syntax.
This is getting kinda awkward but it's all I have.

Karl Dahlke

      parent reply	other threads:[~2019-06-05  7:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05  5:20 Kevin Carhart
2019-06-05  5:49 ` [edbrowse-dev] " Kevin Carhart
2019-06-05  7:07 ` Karl Dahlke [this message]

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:

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

  git send-email \
    --in-reply-to=20190505030735.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=edbrowse-dev@lists.the-brannons.com \


* 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).