Changeset 122555 in webkit
- Timestamp:
- Jul 13, 2012 2:38:50 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r122554 r122555 1 2012-07-13 Vineet Chaudhary <rgf748@motorola.com> 2 3 [V8Bindings] Implement generalised method to validates that the passed object is a sequence type. 4 https://bugs.webkit.org/show_bug.cgi?id=91056 5 6 Reviewed by Kentaro Hara. 7 8 Currently the V8 implementation validates that the passed object is a sequence type only 9 for MessagePort in V8Utilities::extractTransferables(). 10 There should be generalised method for other types too. 11 Spec URL: http://www.w3.org/TR/2012/WD-WebIDL-20120207/#es-sequence 12 13 No new test, Just refactoring. There should be no behavioral changes. 14 15 * bindings/v8/V8Binding.h: 16 (WebCore::toV8Sequence): Added implementation of toV8Sequence(). 17 1 18 2012-07-13 Zeno Albisser <zeno@webkit.org> 2 19 -
trunk/Source/WebCore/bindings/v8/V8Binding.h
r122466 r122555 35 35 #include "DOMDataStore.h" 36 36 #include "PlatformString.h" 37 #include "V8BindingMacros.h" 37 38 #include "V8DOMWrapper.h" 38 39 #include "V8GCController.h" … … 438 439 } 439 440 return result; 441 } 442 443 // Validates that the passed object is a sequence type per WebIDL spec 444 // http://www.w3.org/TR/2012/WD-WebIDL-20120207/#es-sequence 445 inline v8::Handle<v8::Value> toV8Sequence(v8::Handle<v8::Value> value, uint32_t& length) 446 { 447 if (!value->IsObject()) { 448 V8Proxy::throwTypeError(); 449 return v8::Local<v8::Value>(); 450 } 451 452 v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(value)); 453 v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(v8Value); 454 455 EXCEPTION_BLOCK(v8::Local<v8::Value>, lengthValue, object->Get(v8::String::New("length"))); 456 457 if (lengthValue->IsUndefined() || lengthValue->IsNull()) { 458 V8Proxy::throwTypeError(); 459 return v8::Local<v8::Value>(); 460 } 461 462 EXCEPTION_BLOCK(uint32_t, sequenceLength, lengthValue->Int32Value()); 463 length = sequenceLength; 464 465 return v8Value; 440 466 } 441 467
Note: See TracChangeset
for help on using the changeset viewer.