Bug 942631 part 4. Allow WebIDL attributes to return a sequence if it's cached. r=peterv

This commit is contained in:
Boris Zbarsky 2013-12-04 08:02:18 -05:00
Родитель a55415242a
Коммит be8f33b2af
5 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -2652,9 +2652,9 @@ class IDLAttribute(IDLInterfaceMember):
if self.type.isDictionary():
raise WebIDLError("An attribute cannot be of a dictionary type",
[self.location])
if self.type.isSequence():
raise WebIDLError("An attribute cannot be of a sequence type",
[self.location])
if self.type.isSequence() and not self.getExtendedAttribute("Cached"):
raise WebIDLError("A non-cached attribute cannot be of a sequence "
"type", [self.location])
if self.type.isUnion():
for f in self.type.unroll().flatMemberTypes:
if f.isDictionary():

Просмотреть файл

@ -340,6 +340,7 @@ public:
void PassConsequentialInterface(IndirectlyImplementedInterface&);
// Sequence types
void GetReadonlySequence(nsTArray<int32_t>&);
void ReceiveSequence(nsTArray<int32_t>&);
void ReceiveNullableSequence(Nullable< nsTArray<int32_t> >&);
void ReceiveSequenceOfNullableInts(nsTArray< Nullable<int32_t> >&);

Просмотреть файл

@ -295,6 +295,8 @@ interface TestInterface {
void passConsequentialInterface(IndirectlyImplementedInterface arg);
// Sequence types
[Cached, Pure]
readonly attribute sequence<long> readonlySequence;
sequence<long> receiveSequence();
sequence<long>? receiveNullableSequence();
sequence<long?> receiveSequenceOfNullableInts();

Просмотреть файл

@ -191,6 +191,8 @@ interface TestExampleInterface {
void passConsequentialInterface(IndirectlyImplementedInterface arg);
// Sequence types
[Cached, Pure]
readonly attribute sequence<long> readonlySequence;
sequence<long> receiveSequence();
sequence<long>? receiveNullableSequence();
sequence<long?> receiveSequenceOfNullableInts();

Просмотреть файл

@ -212,6 +212,8 @@ interface TestJSImplInterface {
void passConsequentialInterface(IndirectlyImplementedInterface arg);
// Sequence types
[Cached, Pure]
readonly attribute sequence<long> readonlySequence;
sequence<long> receiveSequence();
sequence<long>? receiveNullableSequence();
sequence<long?> receiveSequenceOfNullableInts();