Membranes: filtering own properties, questions on ES7 intent

Alex Vincent ajvincent at gmail.com
Tue Dec 13 08:26:58 UTC 2016


Hello, everyone.  Now that the quarter at my local university is over,
I'm working on my es7-membrane project again.  [1]

In implementing "filterOwnKeys", I realized I have wandered into a
couple of open questions, where I do not know from the ES7
specification what the desirable behavior is.  I have written tests
for these two cases that I've discovered so far, but I currently have
them disabled.  Hopefully this mailing list can provide me with some
insight.

The filterOwnKeys API is pretty much as it sounds:  you name the
object graph and object you want filtering to apply to, and pass in an
array filtering function.

The first "unclear" testcase asks, "Reflect.defineOwnProperty(dry,
'blacklisted', desc) should return what?" [2]  The question there is,
"should didSet be true because we set a value on the wet object graph,
or false because we failed to set a value on the dry object graph?"

The second "unclear" testcase examines "Deleting a blacklisted
property defined on the original target via the dry graph".  [2]  In
this case, defining the property worked (albeit invisibly to the dry
graph), but it's unclear if a delete operation on the property should
propagate.

These questions, by the way, should be explicitly handled when the
membrane customer invokes other modification API's -
"requireLocalDelete" and "storeUnknownAsLocal", specifically.  The
three modification API's, plus a "proxy creation observer" API, will
combine to form a practical whitelisting example.  I am therefore
explicitly asking about what should the proxy API should do in an
otherwise perfect-mirror membrane implementation.

Advice, and debate, is most welcome!

Alex Vincent
Hayward, CA, U.S.A.


[1] https://github.com/ajvincent/es7-membrane
[2] https://github.com/ajvincent/es7-membrane/blob/master/spec/properties/filterOwnKeys.js

-- 
"The first step in confirming there is a bug in someone else's work is
confirming there are no bugs in your own."
-- Alexander J. Vincent, June 30, 2001


More information about the es-discuss mailing list