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

Unified Diff: runtime/vm/native_entry_test.cc

Issue 22303002: Auto create ApiLocalScope before calling native functions, this ensures that (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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 | « runtime/vm/native_entry.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/native_entry_test.cc
===================================================================
--- runtime/vm/native_entry_test.cc (revision 25822)
+++ runtime/vm/native_entry_test.cc (working copy)
@@ -21,7 +21,6 @@
// Arg1: a smi.
// Result: a smi representing arg0 - arg1.
void TestSmiSub(Dart_NativeArguments args) {
- Dart_EnterScope();
Dart_Handle left = Dart_GetNativeArgument(args, 0);
Dart_Handle right = Dart_GetNativeArgument(args, 1);
int64_t left_value = -1;
@@ -32,7 +31,6 @@
// Ignoring overflow in the calculation below.
int64_t result = left_value - right_value;
Dart_SetReturnValue(args, Dart_NewInteger(result));
- Dart_ExitScope();
}
@@ -40,7 +38,6 @@
// Arg0-4: 5 smis.
// Result: a smi representing the sum of all arguments.
void TestSmiSum(Dart_NativeArguments args) {
- Dart_EnterScope();
int64_t result = 0;
int arg_count = Dart_GetNativeArgumentCount(args);
for (int i = 0; i < arg_count; i++) {
@@ -52,7 +49,6 @@
result += arg_value;
}
Dart_SetReturnValue(args, Dart_NewInteger(result));
- Dart_ExitScope();
}
@@ -60,7 +56,6 @@
// Arg0-4: 5 smis or null.
// Result: a smi representing the sum of all non-null arguments.
void TestNonNullSmiSum(Dart_NativeArguments args) {
- Dart_EnterScope();
Isolate* isolate = Isolate::Current();
int64_t result = 0;
int arg_count = Dart_GetNativeArgumentCount(args);
@@ -84,7 +79,6 @@
}
}
Dart_SetReturnValue(args, Dart_NewInteger(result));
- Dart_ExitScope();
}
} // namespace dart
« no previous file with comments | « runtime/vm/native_entry.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698