DescriptionPreviously, Domado internally used a property definition helper called
'definePropertiesAwesomely' which wrapped getters/setters so that they
get an additional argument which is the property name. We now replace
'definePropertiesAwesomely' with 'Props.define', where Props also
contains functions for generating property descriptors. Props.define
accepts, in addition to property descriptors, functions which generate
property descriptors given context ('env') information including the
property name, the object (thus being able to provide setOwn-like
override functionality), and the applicable Confidence.
Including the Confidence in the context also means that PropertyTaming
(renamed PT) does not need to be explicitly instantiated for a
particular Confidence; thus the vocabulary used for amplifying access is
not dependent on the the particular type being defined.
The context-based design of Props is also intended to be of future use
in refactoring the canvas 2D context taming to prototypical style while
keeping its short taming definitions.
User-visible changes:
* There may be more cases where read-only inherited properties can be
overridden by assignment on instances.
Additional changes:
* Nearly all methods are now defined using Props.define rather than as
TameFoo.prototype.bar = nodeAmp(function(privates) { ... }).
Reordered so accessor definitions come before method definitions.
* Introduced PT.ROView to express non-writable tamed properties with
a value transformation.
* browser-test-case.js no longer defines a guest '$' function (because
document.getElementById ends up being an accessor property, which
can't be retrieved without using an inES5Mode conditional) and tests
which used it now define it internally.
* window's reflexive properties are defined in its constructor rather
than separately.
@r5420
Patch Set 1 #
Total comments: 6
Patch Set 2 : Refactor Domado property definitions. #
Total comments: 25
Patch Set 3 : Refactor Domado property definitions. #
MessagesTotal messages: 13
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||