[HtmlUnit] [htmlunit:bugs] #1920 getOwnPropertyDescriptor(input, 'value').get.call is undefined

RBRi via HtmlUnit-develop <[email protected]> Sat, 04 Jan 2020 17:34:45 -0000
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID </p/htmlunit/bugs/1920/7e2d35dcc97949bc4638084e21cb72462bc9861d.bugs@htmlunit.p.sourceforge.net>
This is a multi-part message in MIME format.
--===============8417945482028337435==
Content-Type: multipart/related;
 boundary="===============8934658809191163690=="

This is a multi-part message in MIME format.
--===============8934658809191163690==
Content-Type: multipart/alternative;
 boundary="===============3632830848643273068=="
MIME-Version: 1.0

--===============3632830848643273068==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Testcase added as

com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine2Test.getOwnPropertyDescriptorGetCall()


---

** [bugs:#1920] getOwnPropertyDescriptor(input, 'value').get.call is undefined**

**Status:** accepted
**Group:** Latest SVN
**Created:** Tue Sep 12, 2017 07:25 AM UTC by Atsushi Nakagawa
**Last Updated:** Sun Aug 05, 2018 10:50 AM UTC
**Owner:** nobody


Tested against latest trunk which is r14831.

This is related to [#1900](https://sourceforge.net/p/htmlunit/bugs/1900/) in that its fix is required to uncover this problem.

# Problem:

`Object.getOwnPropertyDescriptor(HTMLInputElement, "value")` returns an instance whose `.get.call` is `undefined`.

# Test:

The following code:

```
<!DOCTYPE html>
<html>
<head>
<script>
function test() {
	var x = Object.getOwnPropertyDescriptor(i1.constructor.prototype, 'value')
    console.log('x = ' + x)
    console.log('x.get = ' + x.get)
    console.log('x.get.call = ' + x.get.call)
}
</script>
</head>
<body>
<input type="text" id="i1" value="foo"/>
<input type="button" onclick="test()" value="test"/>
</body>
</html>
```

Produces something similar to this in major browsers:

```
x = [object Object]
x.get = function () { [native code] }
x.get.call = function call() { [native code] }
```

The result with htmlunit r14831 is:

```
x = [object Object]
x.get = function () { [native code] }
x.get.call = undefined
```


---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/htmlunit/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
--===============3632830848643273068==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit

<div class="markdown_content"><p>Testcase added as</p>
<p>com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine2Test.getOwnPropertyDescriptorGetCall()</p>
<hr/>
<p><strong> <a class="alink" href="https://sourceforge.net/p/htmlunit/bugs/1920/">[bugs:#1920]</a> getOwnPropertyDescriptor(input, 'value').get.call is undefined</strong></p>
<p><strong>Status:</strong> accepted<br/>
<strong>Group:</strong> Latest SVN<br/>
<strong>Created:</strong> Tue Sep 12, 2017 07:25 AM UTC by Atsushi Nakagawa<br/>
<strong>Last Updated:</strong> Sun Aug 05, 2018 10:50 AM UTC<br/>
<strong>Owner:</strong> nobody</p>
<p>Tested against latest trunk which is r14831.</p>
<p>This is related to <a class="" href="https://sourceforge.net/p/htmlunit/bugs/1900/">#1900</a> in that its fix is required to uncover this problem.</p>
<h1 id="problem">Problem:</h1>
<p><code>Object.getOwnPropertyDescriptor(HTMLInputElement, "value")</code> returns an instance whose <code>.get.call</code> is <code>undefined</code>.</p>
<h1 id="test">Test:</h1>
<p>The following code:</p>
<div class="codehilite"><pre><span></span><span class="cp">&lt;!DOCTYPE html&gt;</span>
<span class="p">&lt;</span><span class="nt">html</span><span class="p">&gt;</span>
<span class="p">&lt;</span><span class="nt">head</span><span class="p">&gt;</span>
<span class="p">&lt;</span><span class="nt">script</span><span class="p">&gt;</span>
<span class="kd">function</span> <span class="nx">test</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">x</span> <span class="o">=</span> <span class="nb">Object</span><span class="p">.</span><span class="nx">getOwnPropertyDescriptor</span><span class="p">(</span><span class="nx">i1</span><span class="p">.</span><span class="nx">constructor</span><span class="p">.</span><span class="nx">prototype</span><span class="p">,</span> <span class="s1">'value'</span><span class="p">)</span>
    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'x = '</span> <span class="o">+</span> <span class="nx">x</span><span class="p">)</span>
    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'x.get = '</span> <span class="o">+</span> <span class="nx">x</span><span class="p">.</span><span class="nx">get</span><span class="p">)</span>
    <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">'x.get.call = '</span> <span class="o">+</span> <span class="nx">x</span><span class="p">.</span><span class="nx">get</span><span class="p">.</span><span class="nx">call</span><span class="p">)</span>
<span class="p">}</span>
<span class="p">&lt;/</span><span class="nt">script</span><span class="p">&gt;</span>
<span class="p">&lt;/</span><span class="nt">head</span><span class="p">&gt;</span>
<span class="p">&lt;</span><span class="nt">body</span><span class="p">&gt;</span>
<span class="p">&lt;</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">"text"</span> <span class="na">id</span><span class="o">=</span><span class="s">"i1"</span> <span class="na">value</span><span class="o">=</span><span class="s">"foo"</span><span class="p">/&gt;</span>
<span class="p">&lt;</span><span class="nt">input</span> <span class="na">type</span><span class="o">=</span><span class="s">"button"</span> <span class="na">onclick</span><span class="o">=</span><span class="s">"test()"</span> <span class="na">value</span><span class="o">=</span><span class="s">"test"</span><span class="p">/&gt;</span>
<span class="p">&lt;/</span><span class="nt">body</span><span class="p">&gt;</span>
<span class="p">&lt;/</span><span class="nt">html</span><span class="p">&gt;</span>
</pre></div>


<p>Produces something similar to this in major browsers:</p>
<div class="codehilite"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="p">[</span><span class="n">object</span> <span class="n">Object</span><span class="p">]</span>
<span class="n">x</span><span class="p">.</span><span class="n">get</span> <span class="o">=</span> <span class="n">function</span> <span class="p">()</span> <span class="p">{</span> <span class="p">[</span><span class="n">native</span> <span class="n">code</span><span class="p">]</span> <span class="p">}</span>
<span class="n">x</span><span class="p">.</span><span class="n">get</span><span class="p">.</span><span class="n">call</span> <span class="o">=</span> <span class="n">function</span> <span class="n">call</span><span class="p">()</span> <span class="p">{</span> <span class="p">[</span><span class="n">native</span> <span class="n">code</span><span class="p">]</span> <span class="p">}</span>
</pre></div>


<p>The result with htmlunit r14831 is:</p>
<div class="codehilite"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="p">[</span><span class="n">object</span> <span class="n">Object</span><span class="p">]</span>
<span class="n">x</span><span class="p">.</span><span class="n">get</span> <span class="o">=</span> <span class="n">function</span> <span class="p">()</span> <span class="p">{</span> <span class="p">[</span><span class="n">native</span> <span class="n">code</span><span class="p">]</span> <span class="p">}</span>
<span class="n">x</span><span class="p">.</span><span class="n">get</span><span class="p">.</span><span class="n">call</span> <span class="o">=</span> <span class="n">undefined</span>
</pre></div>


<hr/>
<p>Sent from sourceforge.net because [email protected] is subscribed to <a href="https://sourceforge.net/p/htmlunit/bugs/">https://sourceforge.net/p/htmlunit/bugs/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/htmlunit/admin/bugs/options.">https://sourceforge.net/p/htmlunit/admin/bugs/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>
--===============3632830848643273068==--
--===============8934658809191163690==--


--===============8417945482028337435==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============8417945482028337435==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
HtmlUnit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop

--===============8417945482028337435==--