[HtmlUnit] [htmlunit:bugs] #1920 getOwnPropertyDescriptor(input, 'value').get.call is undefined
RBRi via HtmlUnit-develop <[email protected]> Tue, 14 Jan 2020 19:07:08 -0000
| Newsgroups | gmane.comp.java.htmlunit.devel |
|---|---|
| Message-ID | </p/htmlunit/bugs/1920/a3c458dd8673632b339df736af5930cd74fb69f2.bugs@htmlunit.p.sourceforge.net> |
This is a multi-part message in MIME format.
--===============6218568805379638688==
Content-Type: multipart/related;
boundary="===============2665944150767773893=="
This is a multi-part message in MIME format.
--===============2665944150767773893==
Content-Type: multipart/alternative;
boundary="===============4603619360236192635=="
MIME-Version: 1.0
--===============4603619360236192635==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
- **Comment**:
This is fixed now. As you already mentioned the major part is fixed in Rhino. And the second part was broken because the value prop was not available. This is now also fixed.
Will release shortly.
---
** [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:** Sat Jan 04, 2020 05:34 PM 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.
--===============4603619360236192635==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit
<div class="markdown_content"><ul>
<li><strong>Comment</strong>:</li>
</ul>
<p>This is fixed now. As you already mentioned the major part is fixed in Rhino. And the second part was broken because the value prop was not available. This is now also fixed.<br/>
Will release shortly.</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> Sat Jan 04, 2020 05:34 PM 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"><!DOCTYPE html></span>
<span class="p"><</span><span class="nt">html</span><span class="p">></span>
<span class="p"><</span><span class="nt">head</span><span class="p">></span>
<span class="p"><</span><span class="nt">script</span><span class="p">></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"></</span><span class="nt">script</span><span class="p">></span>
<span class="p"></</span><span class="nt">head</span><span class="p">></span>
<span class="p"><</span><span class="nt">body</span><span class="p">></span>
<span class="p"><</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">/></span>
<span class="p"><</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">/></span>
<span class="p"></</span><span class="nt">body</span><span class="p">></span>
<span class="p"></</span><span class="nt">html</span><span class="p">></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>
--===============4603619360236192635==--
--===============2665944150767773893==--
--===============6218568805379638688==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============6218568805379638688==
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
--===============6218568805379638688==--