Search
Active

1
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Bug
ID: 488360
Opened: 9/6/2009 4:38:11 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
If the code tries to create a new property (Object.defineProperty) that simply reuses an object returned by getOwnPropertyDescriptor, then that property won't work.
Details (expand)

Please verify that this issue occurs in Internet Explorer 8 RTW. Click here for more information.
Yes, this issue is reproduced in IE8 RTW.

1. What seems to be the problem? Click here for more information.
There is a standards issue in Internet Explorer.

2. What area did the issue occur in? Click here for more information.
----Script Errors and Object Model

3. What language of your browser's frame? Click here for more information.
Spanish

3a. What is your language preference order? Click here for more information.
es-Es
 

Please try to reproduce this issue in No Add-ons mode and answer the following 2 questions. You can find the No Add-ons shortcut under All Programs > Accessories > System Tools > Internet Explorer (No Add-ons).  Click here for more information.


4.  What was the result of the issue after trying it in No Add-ons mode?
The issue reproduces in No Add-ons mode

5. If running in No Add-ons mode solves your issue, what kind of Add-ons are you using?
 

5a. If Other, then please list the add-on:
 


6. How often does this happen? Click here for more information.
Always Happens

7. What Operating System are you running? Click here for more information.
Windows XP SP2

8. Have you ever seen this problem before in Internet Explorer? Click here for more information.
I don't know if this issue existed previously

9. Where does this occur?  Click here for more information.
IE8: Default Mode

9a. Please provide the URL of the internet application being used.
http://www.martinezdelizarrondo.com/bugs/defineProperty.html


10. Please list the reproduction steps. Click here for more information.
First create new properties "myValue1" and "myValue2" for every textarea, based on the original .value property

// get the original Property Descriptor for all textareas.value
var originalValuepropDesc = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value");
// Fails
Object.defineProperty(HTMLTextAreaElement.prototype, "myValue1", originalValuepropDesc);
// Fails
Object.defineProperty(HTMLTextAreaElement.prototype, "myValue2",
{
get:originalValuepropDesc.get,
set:originalValuepropDesc.set
});

Then try to read them:
function ReadValue1()
{
alert(document.getElementById("editor1").myValue1);
}
function ReadValue2()
{
alert(document.getElementById("editor1").myValue2);
}

11. What are the expected results? Click here for more information.
return the textarea.value through our new properties.

12. What are the actual results? Click here for more information.
"Invalid argument or procedure call"

The workaround is to define the new property in a more verbose way:
Object.defineProperty(HTMLTextAreaElement.prototype, "myValue3",
{
get: function() {
return originalValuepropDesc.get.call(this);
},
set: function(data) {
originalValuepropDesc.set.call(this, data);
}
}
);
File Attachments
1 attachments
defineProperty.html
Sign in to post a comment.