| OLD | NEW |
| 1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 { | 38 { |
| 39 if (Dart_IsNumber(handle)) { | 39 if (Dart_IsNumber(handle)) { |
| 40 // FIXME: NaN support. | 40 // FIXME: NaN support. |
| 41 double asDouble = DartUtilities::dartToDouble(handle, exception); | 41 double asDouble = DartUtilities::dartToDouble(handle, exception); |
| 42 if (exception) | 42 if (exception) |
| 43 return 0; | 43 return 0; |
| 44 return IDBKey::createNumber(asDouble); | 44 return IDBKey::createNumber(asDouble); |
| 45 } | 45 } |
| 46 | 46 |
| 47 if (Dart_IsString(handle)) { | 47 if (Dart_IsString(handle)) { |
| 48 RefPtr<StringImpl> asStringImpl = DartUtilities::toStringImpl(handle, Da
rtUtilities::ConvertNone, exception); | 48 DartStringAdapter asString = DartUtilities::dartToString(handle, excepti
on); |
| 49 if (exception) | 49 if (exception) |
| 50 return 0; | 50 return 0; |
| 51 return IDBKey::createString(asStringImpl); | 51 return IDBKey::createString(asString); |
| 52 } | 52 } |
| 53 | 53 |
| 54 // FIXME: Support Date case. | 54 // FIXME: Support Date case. |
| 55 | 55 |
| 56 if (Dart_IsList(handle)) { | 56 if (Dart_IsList(handle)) { |
| 57 // FIXME: Support Array case. | 57 // FIXME: Support Array case. |
| 58 exception = DART_UNIMPLEMENTED_EXCEPTION(); | 58 exception = DART_UNIMPLEMENTED_EXCEPTION(); |
| 59 return 0; | 59 return 0; |
| 60 } | 60 } |
| 61 | 61 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 84 return Dart_Null(); | 84 return Dart_Null(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 ASSERT_NOT_REACHED(); | 87 ASSERT_NOT_REACHED(); |
| 88 return Dart_Null(); | 88 return Dart_Null(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 } | 91 } |
| 92 | 92 |
| 93 #endif // ENABLE(INDEXED_DATABASE) | 93 #endif // ENABLE(INDEXED_DATABASE) |
| OLD | NEW |