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

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

Issue 27767003: Convert serialized values to ints if they are whole and less than 53 bits. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
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: Source/bindings/dart/V8Converter.cpp
diff --git a/Source/bindings/dart/V8Converter.cpp b/Source/bindings/dart/V8Converter.cpp
index dd399ffb241fbd9f611929765f23af4a9e0154d6..0c0027b403012a2fd9b163f49cc516ce55e29b39 100644
--- a/Source/bindings/dart/V8Converter.cpp
+++ b/Source/bindings/dart/V8Converter.cpp
@@ -170,8 +170,8 @@ Dart_Handle V8Converter::toDart(v8::Handle<v8::Value> value, V8ToDartMap& map, D
return Dart_Null();
if (value->IsString())
return map.put(value, stringToDart(value));
- if (value->IsInt32())
- return Dart_NewInteger(value->Int32Value());
+ if (value->IsNumber() && value->IntegerValue() <= kJSMaxInteger && value->IntegerValue() >= -kJSMaxInteger)
+ return Dart_NewInteger(value->IntegerValue());
if (value->IsBoolean())
return Dart_NewBoolean(value->BooleanValue());
if (value->IsNumber())

Powered by Google App Engine
This is Rietveld 408576698