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

Unified Diff: lib/date.cc

Issue 10874072: Use the return value of vm native methods to set the return value, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | « lib/byte_array.cc ('k') | lib/double.cc » ('j') | vm/bootstrap_natives.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/date.cc
===================================================================
--- lib/date.cc (revision 11528)
+++ lib/date.cc (working copy)
@@ -24,8 +24,7 @@
Exceptions::ThrowByType(Exceptions::kIllegalArgument, args);
}
const char* name = OS::GetTimeZoneName(seconds);
- const String& dart_name = String::Handle(String::New(name));
- arguments->SetReturn(dart_name);
+ return String::New(name);
}
@@ -38,22 +37,18 @@
Exceptions::ThrowByType(Exceptions::kIllegalArgument, args);
}
int offset = OS::GetTimeZoneOffsetInSeconds(seconds);
- const Integer& dart_offset = Integer::Handle(Integer::New(offset));
- arguments->SetReturn(dart_offset);
+ return Integer::New(offset);
}
DEFINE_NATIVE_ENTRY(DateNatives_localTimeZoneAdjustmentInSeconds, 0) {
int adjustment = OS::GetLocalTimeZoneAdjustmentInSeconds();
- const Integer& dart_adjustment = Integer::Handle(Integer::New(adjustment));
- arguments->SetReturn(dart_adjustment);
+ return Integer::New(adjustment);
}
DEFINE_NATIVE_ENTRY(DateNatives_currentTimeMillis, 0) {
- const Integer& time = Integer::Handle(
- Integer::New(OS::GetCurrentTimeMillis()));
- arguments->SetReturn(time);
+ return Integer::New(OS::GetCurrentTimeMillis());
}
} // namespace dart
« no previous file with comments | « lib/byte_array.cc ('k') | lib/double.cc » ('j') | vm/bootstrap_natives.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698