Illegal operation on WrappedNative prototype object...?

Discuss building things with or for the Mozilla Platform.
Locked
AnimeTheme
Posts: 6
Joined: March 30th, 2004, 6:34 am
Contact:

Illegal operation on WrappedNative prototype object...?

Post by AnimeTheme »

Since the age of Mozilla BETA, I have been using a script (a small part is shown below) to simulate parts of the DOM properties in IE.

-------------------

var p = document.body.style.constructor.prototype

// self.CSS2Properties
// self.CSSStyleDeclaration

p.__defineGetter__("posLeft",
function () {
var num = parseInt(this.left)
if (!num)
num = 0
return num
}
)

p.__defineSetter__("posLeft",
function (num) {
this.left = num + "px"
}
)

-------------------

There have been NO problem until the latest version of FireFox, which returns the following error whenever the .posLeft property is (read/write) accessed (eg. document.getElementById("MyDiv").style.posLeft = 10).

Exception... "Illegal operation on WrappedNative prototype object" nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)"

Part of the problem lies on that "this.left" is neither read or write accessible. Does anyone have any idea how this scripting problem may be solved?
Locked