OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 { | 71 { |
72 setItem(name, value, exceptionState); | 72 setItem(name, value, exceptionState); |
73 return true; | 73 return true; |
74 } | 74 } |
75 | 75 |
76 bool Storage::anonymousIndexedSetter(unsigned index, const AtomicString& value, ExceptionState& exceptionState) | 76 bool Storage::anonymousIndexedSetter(unsigned index, const AtomicString& value, ExceptionState& exceptionState) |
77 { | 77 { |
78 return anonymousNamedSetter(AtomicString::number(index), value, exceptionSta te); | 78 return anonymousNamedSetter(AtomicString::number(index), value, exceptionSta te); |
79 } | 79 } |
80 | 80 |
81 bool Storage::anonymousNamedDeleter(const AtomicString& name, ExceptionState& ex ceptionState) | 81 bool Storage::anonymousNamedDeleter(const AtomicString& name, bool& result, Exce ptionState& exceptionState) |
haraken
2013/12/17 15:59:20
I'm a bit confused. What's the difference between
sof
2013/12/17 16:20:08
We need to represent three outcomes,
* property
sof
2013/12/17 16:24:38
Forgot to say/ask...if the preference is to encode
haraken
2013/12/17 16:51:05
Thanks for the clarification! enum sounds better t
| |
82 { | 82 { |
83 result = false; | |
83 bool found = contains(name, exceptionState); | 84 bool found = contains(name, exceptionState); |
84 if (!found || exceptionState.hadException()) | 85 if (!found || exceptionState.hadException()) |
85 return false; | 86 return false; |
86 removeItem(name, exceptionState); | 87 removeItem(name, exceptionState); |
87 if (exceptionState.hadException()) | 88 if (exceptionState.hadException()) |
88 return false; | 89 return true; |
90 result = true; | |
89 return true; | 91 return true; |
90 } | 92 } |
91 | 93 |
92 bool Storage::anonymousIndexedDeleter(unsigned index, ExceptionState& exceptionS tate) | 94 bool Storage::anonymousIndexedDeleter(unsigned index, ExceptionState& exceptionS tate) |
93 { | 95 { |
94 return anonymousNamedDeleter(AtomicString::number(index), exceptionState); | 96 bool result; |
97 anonymousNamedDeleter(AtomicString::number(index), result, exceptionState); | |
98 return true; | |
95 } | 99 } |
96 | 100 |
97 void Storage::namedPropertyEnumerator(Vector<String>& names, ExceptionState& exc eptionState) | 101 void Storage::namedPropertyEnumerator(Vector<String>& names, ExceptionState& exc eptionState) |
98 { | 102 { |
99 unsigned length = this->length(exceptionState); | 103 unsigned length = this->length(exceptionState); |
100 if (exceptionState.hadException()) | 104 if (exceptionState.hadException()) |
101 return; | 105 return; |
102 names.resize(length); | 106 names.resize(length); |
103 for (unsigned i = 0; i < length; ++i) { | 107 for (unsigned i = 0; i < length; ++i) { |
104 String key = this->key(i, exceptionState); | 108 String key = this->key(i, exceptionState); |
(...skipping 11 matching lines...) Expand all Loading... | |
116 { | 120 { |
117 if (name == "length") | 121 if (name == "length") |
118 return false; | 122 return false; |
119 bool found = contains(name, exceptionState); | 123 bool found = contains(name, exceptionState); |
120 if (exceptionState.hadException() || !found) | 124 if (exceptionState.hadException() || !found) |
121 return false; | 125 return false; |
122 return true; | 126 return true; |
123 } | 127 } |
124 | 128 |
125 } | 129 } |
OLD | NEW |