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

Unified Diff: runtime/vm/object.cc

Issue 50983002: Implement fromEnvironment on bool, int and String (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 4b5b74393e514795f8439479c60d74861fd4070e..cfbb1541444a042684be20b324b5effac5c36d56 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -12375,6 +12375,13 @@ RawInteger* Integer::NewCanonical(const String& str) {
}
+RawInteger* Integer::NewCanonical(int64_t value) {
Ivan Posva 2013/10/29 21:42:59 Please remove as this is not needed anywhere as fa
Søren Gjesse 2013/10/30 11:44:02 Done.
+ if ((value <= Smi::kMaxValue) && (value >= Smi::kMinValue)) {
+ return Smi::New(value);
+ }
+ return Mint::NewCanonical(value);
+}
+
// dart2js represents integers as double precision floats, which can represent
// anything in the range -2^53 ... 2^53.
static bool IsJavascriptInt(int64_t value) {
« runtime/vm/object.h ('K') | « runtime/vm/object.h ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698