Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Style: new String( "abc" ) Date: Wed, 03 Jun 2015 07:57:36 +0200 Organization: PointedEars Software (PES) Lines: 58 Message-ID: <1962100.Vu9JShqaFp@PointedEars.de> References: <2130550.8QLrkFYiEJ@PointedEars.de> <6829198.rnUjZSozy1@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1433311219 25886 eJwFwYERwCAMA7GVapJ3WSfQ8/4jVKIs37eNm5CeQUqRu1v22WySnIuWNZ8Wj0wdVmB+FKgQlA== (3 Jun 2015 06:00:19 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Wed, 3 Jun 2015 06:00:19 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwNwoERwCAIBLCVxJcHxhGB/UdoL1FQ+OxQeXR+1ClreKzw29dcFLFzeqIxc1YaDVYY7vKmtqAyVuXb3vgAUwgVvA== Cancel-Lock: sha1:Ap7tTZ6mBSb/mQ2NrZrBsQG9rhw= X-NNTP-Posting-Host: eJwFwQEBwCAMAzBL0K8tyAG2+ZfwhJ+mnkNUsNm2hpEA4Vd0e+YZuaBQ79LB3Ys3at9HHv4G8xC1 Xref: csiph.com comp.lang.javascript:27973 Andreas Bergmaier wrote: > Thomas 'PointedEars' Lahn schrieb: >> Andreas Bergmaier wrote: >>> This should get you started: >>> http://stackoverflow.com/questions/17256182/what-is-the-difference-between-string-literals-and-string-objects-in-javascript >> >> I do not see anything there that substantiates your claim. Instead, I >> see an answer, , that clearly >> contradicts your claim when it says: >> >> | I'll exemplify with V8 but I assume other engines use similar >> | approaches. >> | >> | A string primitive is parsed to a v8::String object. Hence, methods can >> | be >> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^ >> | invoked directly on it as mentioned by jfriend00. > > I'd assume you've read the next two sentences as well? I have, but they are irrelevant to your claim. > [red herring] > | has to unbox this v8::StringObject's v8::String before executing the > | method, hence it is slower. Your logic is flawed. What you quoted does not change, it rather *emphasizes*, the fact that string primitives *are* parsed into objects by V8, which you claimed they would not be: >>>>>> the primitve "abc" was implicitly converted into an object /three >>>>>> times/. >>>>> In the old times, maybe. Current compilers don't convert anything to >>>>> an object any more here, […] – Andreas Bergmaier in V8 is what can be called a “current script engine”. So it contains a “current compiler”. But that compiler *does* parse string primitives into (v8::String) objects. Therefore, _not_ *all* “current compilers do not convert anything to an object any more there.” Your claim has been refuted by your sources. “Learn reason above all. Learn clear thought: learn to know what is from what seems to be, and what you wish to be.” ─Surak -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.