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


Groups > comp.lang.javascript > #22049

Re: What's wrong with arguments.callee ?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="ISO-8859-1"
Message-ID <5314301.3lsYH2pUt3@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Organization PointedEars Software (PES)
Date Tue, 19 Nov 2013 00:42:23 +0100
User-Agent KNode/4.10.5
Content-Transfer-Encoding 7Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: What's wrong with arguments.callee ?
Newsgroups comp.lang.javascript
References <708973f8-8cc4-409f-b763-f1ef0d455b58@l43g2000hsh.googlegroups.com> <46296233-c493-4de4-921e-2dc9c7870622@googlegroups.com> <1cb35df7-7de2-4139-a31f-100139b5c794@googlegroups.com> <5957377.XgIPmTjdrt@PointedEars.de> <34f9ce58-665f-47db-a18e-f8c34197b9cf@googlegroups.com> <07194009-fe3b-40f4-a75b-769d330613ca@googlegroups.com> <ft91jfg53sty$.1a9stwne9lc9w.dlg@40tude.net> <8d52d023-3809-47b3-82c5-6fee6eff3734@googlegroups.com>
Supersedes <1849997.FUSNMQW7Q7@PointedEars.de>
MIME-Version 1.0
Lines 51
NNTP-Posting-Date 19 Nov 2013 00:42:27 CET
NNTP-Posting-Host 3cbaf2e1.newsspool4.arcor-online.net
X-Trace DXC=n79@VMbK>6jOKO]LCQ@0g`4IUK<Cl32<a4Fo<]lROoRa8kF<OcfhCOkI43oL[SkIcnDZm8W4\YJNlYUVHKH;GI^g;S2JoZ]LBUnS2I:]GMCTdk
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.javascript:22049

Show key headers only | View raw


Michael Haufe (TNO) wrote:

> On Saturday, November 16, 2013 12:35:47 PM UTC-6, JJ wrote:
>> Sorry, I'm not quite good at English and can't understand which part
>> where data is leaked to G. Could you give a simple example code, please?
> 
> function f(x,y,z){
>     console.log([" x:",x," y:",y," z:",z].join(""))
>     g(arguments);
>     console.log([" x:",x," y:",y," z:",z].join(""))
> }
> 
> function g(args){
>     args[0] = "foo"
>     args[1] = "bar"
>     args[2] = args.callee
> }
> 
> f(1,2,3)

I think you have misplaced your spaces and semicolons.  Anyhow:

  function f (x, y, z)
  {
    "use strict";
  
    /* *x: 1, y: 2, z: 3" */
    console.log(["x: ", x, " y: ", y, " z: ", z].join(""));

    g(arguments);

    /* "x: 1, y: 2, z: 3" */
    console.log(["x: ", x, " y: ", y, " z: ", z].join(""));
  }
  
  function g (args)
  {
    args[0] = "foo"
    args[1] = "bar"
    // args[2] = args.callee
  }
  
  f(1, 2, 3);

Therefore, it was _not_ necessary to forbid arguments.callee in strict mode.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

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


Thread

Re: What's wrong with arguments.callee ? aljey1972@gmail.com - 2013-11-15 00:20 -0800
  Re: What's wrong with arguments.callee ? Ry Nohryb <jorge@jorgechamorro.com> - 2013-11-15 01:05 -0800
  Re: What's wrong with arguments.callee ? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-11-15 06:25 -0800
    Re: What's wrong with arguments.callee ? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-15 16:25 +0100
      Re: What's wrong with arguments.callee ? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-11-15 09:50 -0800
        Re: What's wrong with arguments.callee ? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-11-15 21:15 -0800
          Re: What's wrong with arguments.callee ? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-11-16 11:31 +0000
          Re: What's wrong with arguments.callee ? JJ <duh@nah.meh> - 2013-11-17 01:35 +0700
            Re: What's wrong with arguments.callee ? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-11-17 11:34 -0800
              Re: What's wrong with arguments.callee ? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-19 00:42 +0100

csiph-web