| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 if (Dart_IsError(result)) { | 358 if (Dart_IsError(result)) { |
| 359 exception = Dart_NewStringFromCString(Dart_GetError(result)); | 359 exception = Dart_NewStringFromCString(Dart_GetError(result)); |
| 360 return 0; | 360 return 0; |
| 361 } | 361 } |
| 362 if (value < INT_MIN || value > INT_MAX) { | 362 if (value < INT_MIN || value > INT_MAX) { |
| 363 exception = Dart_NewStringFromCString("value out of range"); | 363 exception = Dart_NewStringFromCString("value out of range"); |
| 364 return 0; | 364 return 0; |
| 365 } | 365 } |
| 366 return value; | 366 return value; |
| 367 } | 367 } |
| 368 static Dart_Handle intToDart(int value) | 368 static Dart_Handle intToDart(int64_t value) |
| 369 { | 369 { |
| 370 return Dart_NewInteger(value); | 370 return Dart_NewInteger(value); |
| 371 } | 371 } |
| 372 | 372 |
| 373 static unsigned dartToUnsigned(Dart_Handle, Dart_Handle& exception); | 373 static unsigned dartToUnsigned(Dart_Handle, Dart_Handle& exception); |
| 374 static unsigned dartToUnsigned(Dart_NativeArguments args, int index, Dart_Ha
ndle& exception) | 374 static unsigned dartToUnsigned(Dart_NativeArguments args, int index, Dart_Ha
ndle& exception) |
| 375 { | 375 { |
| 376 int64_t value; | 376 int64_t value; |
| 377 Dart_Handle result = Dart_GetNativeIntegerArgument(args, index, &value); | 377 Dart_Handle result = Dart_GetNativeIntegerArgument(args, index, &value); |
| 378 if (Dart_IsError(result)) { | 378 if (Dart_IsError(result)) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 } | 651 } |
| 652 }; | 652 }; |
| 653 | 653 |
| 654 | 654 |
| 655 #define DART_UNIMPLEMENTED_EXCEPTION() DartUtilities::notImplementedException(__
FILE__, __LINE__) | 655 #define DART_UNIMPLEMENTED_EXCEPTION() DartUtilities::notImplementedException(__
FILE__, __LINE__) |
| 656 #define DART_UNIMPLEMENTED() Dart_ThrowException(DART_UNIMPLEMENTED_EXCEPTION())
; | 656 #define DART_UNIMPLEMENTED() Dart_ThrowException(DART_UNIMPLEMENTED_EXCEPTION())
; |
| 657 | 657 |
| 658 } // namespace WebCore | 658 } // namespace WebCore |
| 659 | 659 |
| 660 #endif // DartUtilities_h | 660 #endif // DartUtilities_h |
| OLD | NEW |