mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Make JSONArguments accept Long values
Summary: This util class was introduced in D42978852 (https://github.com/facebook/react-native/commit/611f9c615ebad7d53c1eb1274fe82e36d915165e), but the Long type was not ported over. Not sure if this was intentional or not, but this is used from return values from DeviceConfig, where number values are encoded as Long types. Changelog: [Internal] - internal Differential Revision: D43323851 fbshipit-source-id: 6a8a27b75b1738f2f87dd56ee814316af323c258
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e328fc2e24
commit
8232c47dcf
@@ -38,6 +38,8 @@ public class JSONArguments {
|
||||
result.putInt(key, (Integer) val);
|
||||
} else if (val instanceof Double) {
|
||||
result.putDouble(key, (Double) val);
|
||||
} else if (val instanceof Long) {
|
||||
result.putInt(key, ((Long) val).intValue());
|
||||
} else if (obj.isNull(key)) {
|
||||
result.putNull(key);
|
||||
} else {
|
||||
@@ -83,6 +85,8 @@ public class JSONArguments {
|
||||
result.pushInt((Integer) val);
|
||||
} else if (val instanceof Double) {
|
||||
result.pushDouble((Double) val);
|
||||
} else if (val instanceof Long) {
|
||||
result.pushInt(((Long) val).intValue());
|
||||
} else if (arr.isNull(i)) {
|
||||
result.pushNull();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user