Re: [heycam/webidl] [[Set]] algorithm for legacy platform objects does not seem to be compatible with the Storage interface (#366)

OK, I will go further and say that I suspect the spec's [[DefineOwnProperty]] is just wrong for things with named setters.  I wrote a testcase:

    var s = sessionStorage;
    Object.defineProperty(s, "foo", { value: "a"});
    console.log(s.getItem("foo"));
    Object.defineProperty(s, "foo", { value: "b"});
    console.log(s.getItem("foo"));

live at https://jsfiddle.net/fxc59fdp/ and the results are:

Firefox: logs "a" then "b"
Chrome: logs "a" then "b"
Safari: logs null then throws a "TypeError: Attempting to change value of a readonly property."
Edge: logs "a" then "b"

none of which match what the spec says (which is "a" then "a" right now).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/366#issuecomment-306310205

Received on Monday, 5 June 2017 21:06:54 UTC