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


Groups > comp.lang.javascript > #16926

Re: Built-in native method

Message-ID <1983193.7UhRnYkZ6n@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2012-10-28 18:07 +0100
Subject Re: Built-in native method
Newsgroups comp.lang.javascript
References (2 earlier) <k69jek$r9i$1@speranza.aioe.org> <3102322.j8kCu7WbkW@PointedEars.de> <k6jgm5$snj$1@speranza.aioe.org> <8635315.16DEVHx3j1@PointedEars.de> <k6jnnq$fro$1@speranza.aioe.org>
Followup-To comp.lang.javascript

Followups directed to: comp.lang.javascript

Show all headers | View raw


Cezary Tomczyk wrote:

> W dniu 2012-10-28 17:12, Thomas 'PointedEars' Lahn pisze:
>> Cezary Tomczyk wrote:
>>> W dniu 2012-10-25 00:03, Thomas 'PointedEars' Lahn pisze:
>>> [...]
>>>>     if (String.prototype.propertyIsEnumerable("trim"))
>>> Quick results from Google Chrome 22.0.1229.94 console.
>> Unreadable.  What is your input, what V8's output?  Which OS and
>> platform?
> 
> OS: Windows 7
> Platform: Win32

I would consider "Windows 7 32-bit" the OS then and "Intel x86 or 
compatibles" the (hardware) platform, but I know what you mean.
 
> Let me do in that way:
> 
> ID - Input data in Google Chrome console
> R - result in console
> 
> ID:   String.prototype.propertyIsEnumerable("trim")
> R:    false
> 
> ID:   String(String.prototype.trim);
> R:    "function trim() { [native code] }"
> 
> ID:   String.prototype.trim = function(){ alert('test'); return false; };
> R:    function (){ alert('test'); return false; }
> 
> ID:   String.prototype.trim
> R:    function (){ alert('test'); return false; }
> 
> ID:   String(String.prototype.trim);
> R:    "function (){ alert('test'); return false; }"

JFYI: In the Chromium/Chrome console a type conversion to String so far is 
implicit for Function instances.
 
> ID:   String.prototype.propertyIsEnumerable("trim")
> R:    false
> 
> Better?

Yes; the same applies to Object.prototype.toString, and probably other 
built-in methods with V8.  Actually, retaining the property attributes is 
required for a conforming implementation per ES 5.1, ยง8.12.5.  I should set 
up a test case as part of the ES Matrix.


PointedEars
-- 
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
  -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)

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


Thread

Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-19 22:07 +0200
  Re: Built-in native method JJ <jaejunks_at@_googlemail_dot._com> - 2012-10-21 06:44 +0000
    Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-21 18:46 +0200
    Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-21 19:37 +0200
      Re: Built-in native method Andreas Bergmaier <andber93@web.de> - 2012-10-22 15:47 +0200
        Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-22 18:00 +0200
          Re: Built-in native method Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-24 02:17 +0100
            Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-24 22:17 +0200
              Re: Built-in native method Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-25 00:32 +0200
  Re: Built-in native method Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-24 02:15 +0100
    Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-24 22:35 +0200
      Re: Built-in native method Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-25 00:03 +0200
        Re: Built-in native method Asen Bozhilov <asen.bozhilov@gmail.com> - 2012-10-26 03:58 -0700
          Re: Built-in native method RobG <rgqld@iinet.net.au> - 2012-10-29 16:39 -0700
        Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-28 15:32 +0100
          Re: Built-in native method Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-28 17:05 +0100
            Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-28 18:39 +0100
              Re: Built-in native method Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-28 20:10 +0100
                Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-28 20:23 +0100
                Re: Built-in native method Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-28 21:23 +0100
                Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-28 22:03 +0100
        Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-28 15:49 +0100
          Re: Built-in native method Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-28 17:12 +0100
            Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-28 17:49 +0100
              Re: Built-in native method Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-28 18:07 +0100
                Re: Built-in native method Cezary Tomczyk <cezary.tomczyk@gmail.com> - 2012-10-28 19:22 +0100
                Re: Built-in native method Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-10-28 19:53 +0100

csiph-web