Page 1 of 1

[v2] possible improvements to rare error msg?

Posted: 07 Aug 2020, 22:25
by swagfag
see https://www.autohotkey.com/boards/viewtopic.php?p=346235#rare_error for a "realworldish" example

Code: Select all

Obj := {}
Obj.DefineProperty('myProp', {
    get: {} ; "function object", lacking .Call()
})
MsgBox Obj.HasOwnProp('myProp') ; true
MsgBox Obj.myProp ; "... doesnt have a property named 'myProp'"
basically, the problem is if u define a dynamic property, and rig its getter(and/or setter) to invoke an object that doesnt implement a .Call() method(most likely due to script coding errors), the property will get defined(ie, .HasOwnProp() for it returning true), however, when the property is invoked, the error msg will claim the object has no such property.

while this alerts the user that there is an error, the msg is misleading
this was fixed in a120 actually