| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 265 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
| 266 { | 266 { |
| 267 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 267 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
| 268 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyDel
eter(index, info); | 268 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::indexedPropertyDel
eter(index, info); |
| 269 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 269 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 270 } | 270 } |
| 271 | 271 |
| 272 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 272 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
| 273 { | 273 { |
| 274 if (info.Holder()->HasRealNamedProperty(name)) |
| 275 return; |
| 274 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 276 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 275 return; | 277 return; |
| 276 if (info.Holder()->HasRealNamedCallbackProperty(name)) | |
| 277 return; | |
| 278 if (info.Holder()->HasRealNamedProperty(name)) | |
| 279 return; | |
| 280 | 278 |
| 281 TestSpecialOperationsIdentifierRaisesException* collection = V8TestSpecialOp
erationsIdentifierRaisesException::toNative(info.Holder()); | 279 TestSpecialOperationsIdentifierRaisesException* collection = V8TestSpecialOp
erationsIdentifierRaisesException::toNative(info.Holder()); |
| 282 AtomicString propertyName = toCoreAtomicString(name); | 280 AtomicString propertyName = toCoreAtomicString(name); |
| 283 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 281 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
| 284 RefPtr<TestInterfaceEmpty> element = collection->namedItem(propertyName, exc
eptionState); | 282 RefPtr<TestInterfaceEmpty> element = collection->namedItem(propertyName, exc
eptionState); |
| 285 if (exceptionState.throwIfNeeded()) | 283 if (exceptionState.throwIfNeeded()) |
| 286 return; | 284 return; |
| 287 if (!element) | 285 if (!element) |
| 288 return; | 286 return; |
| 289 v8SetReturnValueFast(info, element.release(), collection); | 287 v8SetReturnValueFast(info, element.release(), collection); |
| 290 } | 288 } |
| 291 | 289 |
| 292 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 290 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
| 293 { | 291 { |
| 294 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
| 295 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyGette
r(name, info); | 293 TestSpecialOperationsIdentifierRaisesExceptionV8Internal::namedPropertyGette
r(name, info); |
| 296 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 297 } | 295 } |
| 298 | 296 |
| 299 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) | 297 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 300 { | 298 { |
| 299 if (info.Holder()->HasRealNamedProperty(name)) |
| 300 return; |
| 301 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 301 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
| 302 return; | 302 return; |
| 303 if (info.Holder()->HasRealNamedCallbackProperty(name)) | |
| 304 return; | |
| 305 if (info.Holder()->HasRealNamedProperty(name)) | |
| 306 return; | |
| 307 | 303 |
| 308 TestSpecialOperationsIdentifierRaisesException* collection = V8TestSpecialOp
erationsIdentifierRaisesException::toNative(info.Holder()); | 304 TestSpecialOperationsIdentifierRaisesException* collection = V8TestSpecialOp
erationsIdentifierRaisesException::toNative(info.Holder()); |
| 309 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name)
; | 305 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name)
; |
| 310 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsVa
lue); | 306 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsVa
lue); |
| 311 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 307 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
| 312 bool result = collection->setNamedItem(propertyName, propertyValue, exceptio
nState); | 308 bool result = collection->setNamedItem(propertyName, propertyValue, exceptio
nState); |
| 313 if (exceptionState.throwIfNeeded()) | 309 if (exceptionState.throwIfNeeded()) |
| 314 return; | 310 return; |
| 315 if (!result) | 311 if (!result) |
| 316 return; | 312 return; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 fromInternalPointer(object)->deref(); | 456 fromInternalPointer(object)->deref(); |
| 461 } | 457 } |
| 462 | 458 |
| 463 template<> | 459 template<> |
| 464 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsIdentifierRaisesExceptio
n* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 460 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsIdentifierRaisesExceptio
n* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 465 { | 461 { |
| 466 return toV8(impl, creationContext, isolate); | 462 return toV8(impl, creationContext, isolate); |
| 467 } | 463 } |
| 468 | 464 |
| 469 } // namespace WebCore | 465 } // namespace WebCore |
| OLD | NEW |