Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #32283

Re: [Firefox]"print"

Path csiph.com!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: [Firefox]"print"
Date Tue, 24 Jan 2017 01:52:39 +0100
Organization PointedEars Software (PES)
Lines 91
Message-ID <42447262.MN2xkq1pzW@PointedEars.de> (permalink)
References <8b2dc802-a0d2-4ae0-ba75-98ecf5989e64@googlegroups.com> <87bmv2erpx.fsf@bsb.me.uk> <const-20170119213913@ram.dialup.fu-berlin.de> <print-20170120103915@ram.dialup.fu-berlin.de> <Object.getOwnPropertyDescriptor-20170123205042@ram.dialup.fu-berlin.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1485219160 5728 eJwFwYEBwDAEBMCVXnh0HBL2H6F3VBe/YU43LvchYtn3CM8KAzRQ6mTAs4HymexH7mjXpz8F/BCV (24 Jan 2017 00:52:40 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Tue, 24 Jan 2017 00:52:40 +0000 (UTC)
User-Agent KNode/4.14.2
Cancel-Lock sha1:Ya3gWNX7RU/YLEQAa8tIRCV1TLc=
X-NNTP-Posting-Host eJwFwQcBwEAIBDBLQJlynnH+JTSxz9kn1M3VYIiJLhpmSeyuMU4QeXT3yhJ8pL1di9Yn2B8vwBJY
X-User-ID eJwNwokRACEIBLCWeNwFy0HQ/ku4ywROZcciuPDw8qY6m5d3+l/kWAAxqKMa2+btIybWVj5eyhT6ZB2pV/gAZJUV4w==
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b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Show key headers only | View raw


Stefan Ram kept talking to himself:

> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>> Let's look at the property:
>> Object.getOwnPropertyDescriptor( this, print )
>> undefined
> 
>   Ok, I should have written:
> 
> Object.getOwnPropertyDescriptor( this, "print" )

“print” in Mozilla JavaScript is still something else than
“this.print” (in global browser context equivalent to “window.print”):

| $ dpkg -l libmozjs-24-bin | grep ^.i
| ii  libmozjs-24-bin 24.2.0-2     amd64       Spidermonkey JavaScript shell
| 
| $ dpkg -L libmozjs-24-bin 
| /.
| /usr
| /usr/bin
| /usr/bin/js24
| /usr/share
| /usr/share/doc
| /usr/share/doc/libmozjs-24-bin
| /usr/share/doc/libmozjs-24-bin/changelog.Debian.gz
| /usr/share/doc/libmozjs-24-bin/copyright 
| 
| $ js24
| js> help(print);
| JavaScript-C24.2.0
| print([exp ...])
|   Evaluate and print expressions to stdout.
| js> 

By contrast,

| $ js --help | head -n 1
| Usage: node [options] [ -e script | script.js ] [arguments] 
| 
| $ js -v
| v0.10.38

Node.js 0.10.38, …

| $ js -e 'console.log(process.versions.v8);'
| 3.14.5.8

based on Google V8 JavaScript 3.14.5.8):

| $ js -e 'print(42);'
| 
| [eval]:1
| print(42);
| ^
| ReferenceError: print is not defined
|     at [eval]:1:1
|     at Object.<anonymous> ([eval]-wrapper:6:22)
|     at Module._compile (module.js:456:26)
|     at evalScript (node.js:536:25)
|     at startup (node.js:80:7)
|     at node.js:906:3

So this has nothing to do with Firefox and its Web Console, everything with 
the ECMAScript implementation (provided by the Gecko layout engine) that is 
used by it.

It is most obvious in the result of what you have *not* tried so far:

,-[Iceweasel 38.1.0 Web Console]
| 
| 01:28:04.562 > print();
| 01:28:04.569 < "undefined"
| 01:28:09.221 > print
| 01:28:09.230 < function JSTH_print()
| 01:28:16.522 > this.print
| 01:28:16.538 < function print()
| 01:31:00.768 > window.print
| 01:31:00.775 < function print()
| 01:31:13.967 > this.print === window.print
| 01:31:13.974 < true
| 01:31:49.429 > print(42);
| 01:31:49.436 < "42"

(Exercise: Try the same in Chromium or Chrome.)

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-18 20:09 -0800
  Re: Functional Programming needs some real world use cases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-19 20:10 +0000
    Re: Functional Programming needs some real world use cases Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-19 21:16 +0100
      Re: Functional Programming needs some real world use cases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-19 21:24 +0000
    Re: Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-19 12:34 -0800
      Re: Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-19 12:41 -0800
        Re: Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-19 13:01 -0800
          Re: Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-19 17:26 -0800
    Re: Functional Programming needs some real world use cases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-19 21:23 +0000
      Re: Functional Programming needs some real world use cases Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-19 21:50 +0000
    Re: [Firefox]"print" Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-24 01:52 +0100
      Re: [Firefox]"print" Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-24 05:45 +0100
  Re: Functional Programming needs some real world use cases Scott Sauyet <scott@sauyet.com> - 2017-01-20 04:28 +0000
    Re: Functional Programming needs some real world use cases justaguy <lichunshen84@gmail.com> - 2017-01-19 21:18 -0800
    Re: Functional Programming needs some real world use cases John Harris <niam@jghnorth.org.uk.invalid> - 2017-01-20 10:22 +0000
      Re: Functional Programming needs some real world use cases Scott Sauyet <scott@sauyet.com> - 2017-01-21 01:29 +0000
    Re: Functional Programming needs some real world use cases Scott Sauyet <scott@sauyet.com> - 2017-01-21 01:15 +0000
    Re: Functional Programming needs some real world use cases "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-01-21 15:00 -0800
  Re: Functional Programming needs some real world use cases Scott Sauyet <scott@sauyet.com> - 2017-01-20 05:00 +0000
  Re: Functional Programming needs some real world use cases Scott Sauyet <scott@sauyet.com> - 2017-01-20 05:02 +0000

csiph-web