Bug 947351. [Constant] things don't need a way to clear a cached value, since they're not supposed to change. r=peterv

This commit is contained in:
Boris Zbarsky 2013-12-06 13:49:44 -05:00
parent 0641816139
commit b1c250a89f
5 changed files with 12 additions and 1 deletions

View File

@ -8748,7 +8748,11 @@ class CGDescriptor(CGThing):
if descriptor.wrapperCache:
cgThings.extend(CGClearCachedValueMethod(descriptor, m) for
m in descriptor.interface.members if
m.isAttr() and m.slotIndex is not None)
m.isAttr() and
# Constants should never need clearing!
not m.getExtendedAttribute("Constant") and
not m.getExtendedAttribute("SameObject") and
m.slotIndex is not None)
# CGCreateInterfaceObjectsMethod needs to come after our
# CGDOMJSClass, if any.

View File

@ -169,6 +169,7 @@ public:
void PassOptionalNullableByte(const Optional< Nullable<int8_t> >&);
void PassVariadicByte(const Sequence<int8_t>&);
int8_t CachedByte();
int8_t CachedConstantByte();
int8_t CachedWritableByte();
void SetCachedWritableByte(int8_t);

View File

@ -126,6 +126,8 @@ interface TestInterface {
void passVariadicByte(byte... arg);
[StoreInSlot, Pure]
readonly attribute byte cachedByte;
[StoreInSlot, Constant]
readonly attribute byte cachedConstantByte;
[StoreInSlot, Pure]
attribute byte cachedWritableByte;

View File

@ -31,6 +31,8 @@ interface TestExampleInterface {
void passVariadicByte(byte... arg);
[Cached, Pure]
readonly attribute byte cachedByte;
[StoreInSlot, Constant]
readonly attribute byte cachedConstantByte;
[Cached, Pure]
attribute byte cachedWritableByte;

View File

@ -43,6 +43,8 @@ interface TestJSImplInterface {
void passVariadicByte(byte... arg);
[Cached, Pure]
readonly attribute byte cachedByte;
[Cached, Constant]
readonly attribute byte cachedConstantByte;
[Cached, Pure]
attribute byte cachedWritableByte;