| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 return ret.release(); | 404 return ret.release(); |
| 405 } | 405 } |
| 406 | 406 |
| 407 if (!v8Value->IsArray()) | 407 if (!v8Value->IsArray()) |
| 408 return 0; | 408 return 0; |
| 409 | 409 |
| 410 RefPtr<DOMStringList> ret = DOMStringList::create(); | 410 RefPtr<DOMStringList> ret = DOMStringList::create(); |
| 411 v8::Local<v8::Array> v8Array = v8::Local<v8::Array>::Cast(v8Value); | 411 v8::Local<v8::Array> v8Array = v8::Local<v8::Array>::Cast(v8Value); |
| 412 for (size_t i = 0; i < v8Array->Length(); ++i) { | 412 for (size_t i = 0; i < v8Array->Length(); ++i) { |
| 413 v8::Local<v8::Value> indexedValue = v8Array->Get(v8::Integer::New(i, iso
late)); | 413 v8::Local<v8::Value> indexedValue = v8Array->Get(v8::Integer::New(i, iso
late)); |
| 414 ret->append(toWebCoreString(indexedValue)); | 414 V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(V8StringResource<>, stringValue,
indexedValue, 0); |
| 415 ret->append(stringValue); |
| 415 } | 416 } |
| 416 return ret.release(); | 417 return ret.release(); |
| 417 } | 418 } |
| 418 | 419 |
| 419 PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value> value, v8::I
solate* isolate) | 420 PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value> value, v8::I
solate* isolate) |
| 420 { | 421 { |
| 421 RefPtr<XPathNSResolver> resolver; | 422 RefPtr<XPathNSResolver> resolver; |
| 422 if (V8XPathNSResolver::HasInstance(value, isolate, worldType(isolate))) | 423 if (V8XPathNSResolver::HasInstance(value, isolate, worldType(isolate))) |
| 423 resolver = V8XPathNSResolver::toNative(v8::Handle<v8::Object>::Cast(valu
e)); | 424 resolver = V8XPathNSResolver::toNative(v8::Handle<v8::Object>::Cast(valu
e)); |
| 424 else if (value->IsObject()) | 425 else if (value->IsObject()) |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 if (context && context->isDocument()) { | 596 if (context && context->isDocument()) { |
| 596 static v8::Isolate* mainWorldIsolate = 0; | 597 static v8::Isolate* mainWorldIsolate = 0; |
| 597 if (!mainWorldIsolate) | 598 if (!mainWorldIsolate) |
| 598 mainWorldIsolate = v8::Isolate::GetCurrent(); | 599 mainWorldIsolate = v8::Isolate::GetCurrent(); |
| 599 return mainWorldIsolate; | 600 return mainWorldIsolate; |
| 600 } | 601 } |
| 601 return v8::Isolate::GetCurrent(); | 602 return v8::Isolate::GetCurrent(); |
| 602 } | 603 } |
| 603 | 604 |
| 604 } // namespace WebCore | 605 } // namespace WebCore |
| OLD | NEW |