OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 static v8::Handle<v8::Value> storageSetter(v8::Local<v8::String> v8Name, v8::Loc
al<v8::Value> v8Value, const v8::AccessorInfo& info) | 95 static v8::Handle<v8::Value> storageSetter(v8::Local<v8::String> v8Name, v8::Loc
al<v8::Value> v8Value, const v8::AccessorInfo& info) |
96 { | 96 { |
97 Storage* storage = V8Storage::toNative(info.Holder()); | 97 Storage* storage = V8Storage::toNative(info.Holder()); |
98 String name = toWebCoreString(v8Name); | 98 String name = toWebCoreString(v8Name); |
99 String value = toWebCoreString(v8Value); | 99 String value = toWebCoreString(v8Value); |
100 | 100 |
101 // Silently ignore length (rather than letting the bindings raise an excepti
on). | 101 // Silently ignore length (rather than letting the bindings raise an excepti
on). |
102 if (name == "length") | 102 if (name == "length") |
103 return v8Value; | 103 return v8Value; |
104 | 104 |
105 v8::Handle<v8::Value> prototypeValue = info.Holder()->GetRealNamedPropertyIn
PrototypeChain(v8Name); | 105 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(v8Name).IsEmpty()) |
106 if (!prototypeValue.IsEmpty()) | |
107 return notHandledByInterceptor(); | 106 return notHandledByInterceptor(); |
108 | 107 |
109 ExceptionCode ec = 0; | 108 ExceptionCode ec = 0; |
110 storage->setItem(name, value, ec); | 109 storage->setItem(name, value, ec); |
111 if (ec) | 110 if (ec) |
112 return throwError(ec); | 111 return throwError(ec); |
113 | 112 |
114 return v8Value; | 113 return v8Value; |
115 } | 114 } |
116 | 115 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 148 |
150 v8::Handle<v8::Boolean> V8Storage::namedPropertyDeleter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) | 149 v8::Handle<v8::Boolean> V8Storage::namedPropertyDeleter(v8::Local<v8::String> na
me, const v8::AccessorInfo& info) |
151 { | 150 { |
152 INC_STATS("DOM.Storage.NamedPropertyDeleter"); | 151 INC_STATS("DOM.Storage.NamedPropertyDeleter"); |
153 return storageDeleter(name, info); | 152 return storageDeleter(name, info); |
154 } | 153 } |
155 | 154 |
156 } // namespace WebCore | 155 } // namespace WebCore |
157 | 156 |
158 #endif | 157 #endif |
OLD | NEW |