| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. | 3 * Copyright (C) 2012 Ericsson AB. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 if (value->IsArray()) { | 539 if (value->IsArray()) { |
| 540 length = v8::Local<v8::Array>::Cast(v8Value)->Length(); | 540 length = v8::Local<v8::Array>::Cast(v8Value)->Length(); |
| 541 } else if (toV8Sequence(value, length, isolate).IsEmpty()) { | 541 } else if (toV8Sequence(value, length, isolate).IsEmpty()) { |
| 542 throwTypeError(ExceptionMessages::notASequenceTypeProperty(propertyName)
, isolate); | 542 throwTypeError(ExceptionMessages::notASequenceTypeProperty(propertyName)
, isolate); |
| 543 return Vector<RefPtr<T> >(); | 543 return Vector<RefPtr<T> >(); |
| 544 } | 544 } |
| 545 return toRefPtrNativeArrayUnchecked<T, V8T>(v8Value, length, isolate, succes
s); | 545 return toRefPtrNativeArrayUnchecked<T, V8T>(v8Value, length, isolate, succes
s); |
| 546 } | 546 } |
| 547 | 547 |
| 548 template <class T, class V8T> | 548 template <class T, class V8T> |
| 549 HeapVector<Member<T> > toRefPtrWillBeMemberNativeArray(v8::Handle<v8::Value> val
ue, int argumentIndex, v8::Isolate* isolate, bool* success = 0) | 549 WillBeHeapVector<RefPtrWillBeMember<T> > toRefPtrWillBeMemberNativeArray(v8::Han
dle<v8::Value> value, int argumentIndex, v8::Isolate* isolate, bool* success = 0
) |
| 550 { | 550 { |
| 551 if (success) | 551 if (success) |
| 552 *success = true; | 552 *success = true; |
| 553 | 553 |
| 554 v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value)); | 554 v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(isolate, value)); |
| 555 uint32_t length = 0; | 555 uint32_t length = 0; |
| 556 if (value->IsArray()) { | 556 if (value->IsArray()) { |
| 557 length = v8::Local<v8::Array>::Cast(v8Value)->Length(); | 557 length = v8::Local<v8::Array>::Cast(v8Value)->Length(); |
| 558 } else if (toV8Sequence(value, length, isolate).IsEmpty()) { | 558 } else if (toV8Sequence(value, length, isolate).IsEmpty()) { |
| 559 throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(argument
Index), isolate); | 559 throwTypeError(ExceptionMessages::notAnArrayTypeArgumentOrValue(argument
Index), isolate); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 | 759 |
| 760 private: | 760 private: |
| 761 v8::HandleScope m_handleScope; | 761 v8::HandleScope m_handleScope; |
| 762 v8::Context::Scope m_contextScope; | 762 v8::Context::Scope m_contextScope; |
| 763 RefPtr<NewScriptState> m_scriptState; | 763 RefPtr<NewScriptState> m_scriptState; |
| 764 }; | 764 }; |
| 765 | 765 |
| 766 } // namespace WebCore | 766 } // namespace WebCore |
| 767 | 767 |
| 768 #endif // V8Binding_h | 768 #endif // V8Binding_h |
| OLD | NEW |