Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Unified Diff: Source/bindings/dart/DartUtilities.cpp

Issue 28763006: Support $0, $1, ... $6, inspect, and other console api methods. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: ready for review Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/dart/DartUtilities.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/DartUtilities.cpp
diff --git a/Source/bindings/dart/DartUtilities.cpp b/Source/bindings/dart/DartUtilities.cpp
index 20b8dd792a6ba216b7fb3f181e7d5a09f277c1f2..5157081af994bf9494be6f37ce3880412123a5a3 100644
--- a/Source/bindings/dart/DartUtilities.cpp
+++ b/Source/bindings/dart/DartUtilities.cpp
@@ -250,13 +250,26 @@ void DartUtilities::extractListElements(Dart_Handle list, Dart_Handle& exception
intptr_t length = 0;
Dart_ListLength(list, &length);
elements.reserveCapacity(length);
- for (int i = 0; i < length; i++) {
+ for (size_t i = 0; i < length; i++) {
Dart_Handle element = Dart_ListGetAt(list, i);
ASSERT(!Dart_IsError(element));
elements.append(element);
}
}
+Dart_Handle DartUtilities::toList(const Vector<Dart_Handle>& elements, Dart_Handle& exception)
+{
+ Dart_Handle ret = Dart_NewList(elements.size());
+ if (Dart_IsError(ret)) {
+ exception = ret;
+ return Dart_Null();
+ }
+ for (size_t i = 0; i < elements.size(); i++) {
+ Dart_ListSetAt(ret, i, elements[i]);
+ }
+ return ret;
+}
+
v8::Local<v8::Context> DartUtilities::currentV8Context()
{
Frame* frame = DartUtilities::domWindowForCurrentIsolate()->frame();
« no previous file with comments | « Source/bindings/dart/DartUtilities.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698