Tom Van Cutsem wrote:

    Another potential consistency issue is between [[HasOwnProperty]]
    and [[GetOwnProperty]].  That could be eliminated by combining
    them into one operation:

    [[GetOwnPropety]](name, descriptorNeeded) -> descriptor | boolean
    | undefined

    If descriptorNeeded is true it acts as the current
    [[GetOwnProperty]]. If descriptorNeeded is false it acts as the
    current [[HasOwnProperty]].

    At the handler-level it makes it impossible to override
    "hasOwn"without also overriding "getOwnPropertyDescriptor"


I understand the goals, but I'm not a big fan of fusing traps like this. It trades complexity on one level (inconsistencies between traps) for complexity on another level (if-tests in fused trap bodies to determine what type of value to return).

Agreed. That kind of return value overloading has a smell.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to