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] NASA is so weird we may never understand it
Date: Fri, 16 Mar 2018 11:26:00 -0400	[thread overview]
Message-ID: <20180216112600.eklhad@comcast.net> (raw)

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

First, a new feature, which for laziness is overloaded on an old feature.

uvw trace

At db3 or higher, this injects codes into the output stream as to where execution is happening.

d254    (for illustration)

The letter is the script running and the number is a meaningless sequence number.
If you look in the script vendor.js for nasa you'll find alert3('d254');
Such an alert is placed before each var, since those are the only syntactically safe places to do so.
I couldn't find any other place that is safe.
So only about 9% of lines havve markers, but it's something.

vendor.js in nasa is 43,000 lines of nightmare.
I believe it equalizes all javascript environments for third party companies or government agencies,
and it puts a layer on top of javascript, like jquery, but of course it's not jquery, because why use something that's standard and established and has a pool of people who understand it when you can come up with something new?
Anyways, here are two of many weirdnesses.

Out of the box, there is no sinh function hyperbolic sine.
Math.sinh is undefined.
After vendor.js runs Math.sinh exists and runs the correct calculations. (I checked)
Fine, a script can always paste a function onto Math that was not there before.
No mystery so far.
But, in jdb, Math.sinh says the function is native code.
vendor.js can't possibly add native code.
I can even find the javascript that does the hyperbolic sine calculation.
It's not native, so what gives?
I can only guess that vendor.js put it's own toString() function on sinh,
so it would blurt out the words "native code", because on some browsers, it is native,
and remember, we want all browsers to look the same.
So I guess that's what they did, but even more than that.
I think they did something like this.

Math.sinh.toString = Math.sqrt.toString

Borrow the toString from a function that is already there.
Verified by

Math.sqrt.toString == Math.sinh.toString
true

The next weirdness is even weirder.
>From inside jdb, type

"abc".match(/./)
d254
a

Yes, a piece of vendor.js runs when you ask whether a string matches a regular expression.
Somehow the String object method match has been overwritten.
String.match = their stuff.
Are you serious!!
Same happens with "abc".split("b"), but not with "abc".substr(1).
They chose to overwrite some of the String methods but not all.

With all this in mind, we'd have to hire a fulltime engineer just to understand the nasa website and/or vendor.js.
Obviously we don't have the resources to do that.

Karl Dahlke

             reply	other threads:[~2018-03-16 15:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16 15:26 Karl Dahlke [this message]
2018-03-18  6:43 ` Kevin Carhart

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=20180216112600.eklhad@comcast.net \
    --to=eklhad@comcast.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).