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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 v8::Handle<v8::Value> v8Array(PassRefPtr<DOMStringList> stringList, v8::Isolate*
isolate) | 91 v8::Handle<v8::Value> v8Array(PassRefPtr<DOMStringList> stringList, v8::Isolate*
isolate) |
92 { | 92 { |
93 if (!stringList) | 93 if (!stringList) |
94 return v8::Array::New(); | 94 return v8::Array::New(); |
95 v8::Local<v8::Array> result = v8::Array::New(stringList->length()); | 95 v8::Local<v8::Array> result = v8::Array::New(stringList->length()); |
96 for (unsigned i = 0; i < stringList->length(); ++i) | 96 for (unsigned i = 0; i < stringList->length(); ++i) |
97 result->Set(v8Integer(i, isolate), v8String(stringList->item(i), isolate
)); | 97 result->Set(v8Integer(i, isolate), v8String(stringList->item(i), isolate
)); |
98 return result; | 98 return result; |
99 } | 99 } |
100 | 100 |
| 101 Vector<v8::Handle<v8::Value> > toVectorOfArguments(const v8::Arguments& args) |
| 102 { |
| 103 Vector<v8::Handle<v8::Value> > result; |
| 104 size_t length = args.Length(); |
| 105 for (size_t i = 0; i < length; ++i) |
| 106 result.append(args[i]); |
| 107 return result; |
| 108 } |
| 109 |
101 PassRefPtr<NodeFilter> toNodeFilter(v8::Handle<v8::Value> callback) | 110 PassRefPtr<NodeFilter> toNodeFilter(v8::Handle<v8::Value> callback) |
102 { | 111 { |
103 return NodeFilter::create(V8NodeFilterCondition::create(callback)); | 112 return NodeFilter::create(V8NodeFilterCondition::create(callback)); |
104 } | 113 } |
105 | 114 |
106 const int32_t kMaxInt32 = 0x7fffffff; | 115 const int32_t kMaxInt32 = 0x7fffffff; |
107 const int32_t kMinInt32 = -kMaxInt32 - 1; | 116 const int32_t kMinInt32 = -kMaxInt32 - 1; |
108 const uint32_t kMaxUInt32 = 0xffffffff; | 117 const uint32_t kMaxUInt32 = 0xffffffff; |
109 const int64_t kJSMaxInteger = 0x20000000000000LL - 1; // 2^53 - 1, maximum integ
er exactly representable in ECMAScript. | 118 const int64_t kJSMaxInteger = 0x20000000000000LL - 1; // 2^53 - 1, maximum integ
er exactly representable in ECMAScript. |
110 | 119 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 if (!DOMWrapperWorld::isolatedWorldsExist()) | 402 if (!DOMWrapperWorld::isolatedWorldsExist()) |
394 return MainWorld; | 403 return MainWorld; |
395 ASSERT(!v8::Context::GetEntered().IsEmpty()); | 404 ASSERT(!v8::Context::GetEntered().IsEmpty()); |
396 DOMWrapperWorld* isolatedWorld = DOMWrapperWorld::isolatedWorld(v8::Context:
:GetEntered()); | 405 DOMWrapperWorld* isolatedWorld = DOMWrapperWorld::isolatedWorld(v8::Context:
:GetEntered()); |
397 if (isolatedWorld) | 406 if (isolatedWorld) |
398 return IsolatedWorld; | 407 return IsolatedWorld; |
399 return MainWorld; | 408 return MainWorld; |
400 } | 409 } |
401 | 410 |
402 } // namespace WebCore | 411 } // namespace WebCore |
OLD | NEW |