| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 if (Dart_IsError(result)) { | 357 if (Dart_IsError(result)) { |
| 358 exception = Dart_NewStringFromCString(Dart_GetError(result)); | 358 exception = Dart_NewStringFromCString(Dart_GetError(result)); |
| 359 return 0; | 359 return 0; |
| 360 } | 360 } |
| 361 if (value < INT_MIN || value > INT_MAX) { | 361 if (value < INT_MIN || value > INT_MAX) { |
| 362 exception = Dart_NewStringFromCString("value out of range"); | 362 exception = Dart_NewStringFromCString("value out of range"); |
| 363 return 0; | 363 return 0; |
| 364 } | 364 } |
| 365 return value; | 365 return value; |
| 366 } | 366 } |
| 367 static Dart_Handle intToDart(int value) | 367 static Dart_Handle intToDart(int64_t value) |
| 368 { | 368 { |
| 369 return Dart_NewInteger(value); | 369 return Dart_NewInteger(value); |
| 370 } | 370 } |
| 371 | 371 |
| 372 static unsigned dartToUnsigned(Dart_Handle, Dart_Handle& exception); | 372 static unsigned dartToUnsigned(Dart_Handle, Dart_Handle& exception); |
| 373 static unsigned dartToUnsigned(Dart_NativeArguments args, int index, Dart_Ha
ndle& exception) | 373 static unsigned dartToUnsigned(Dart_NativeArguments args, int index, Dart_Ha
ndle& exception) |
| 374 { | 374 { |
| 375 int64_t value; | 375 int64_t value; |
| 376 Dart_Handle result = Dart_GetNativeIntegerArgument(args, index, &value); | 376 Dart_Handle result = Dart_GetNativeIntegerArgument(args, index, &value); |
| 377 if (Dart_IsError(result)) { | 377 if (Dart_IsError(result)) { |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 } | 634 } |
| 635 }; | 635 }; |
| 636 | 636 |
| 637 | 637 |
| 638 #define DART_UNIMPLEMENTED_EXCEPTION() DartUtilities::notImplementedException(__
FILE__, __LINE__) | 638 #define DART_UNIMPLEMENTED_EXCEPTION() DartUtilities::notImplementedException(__
FILE__, __LINE__) |
| 639 #define DART_UNIMPLEMENTED() Dart_ThrowException(DART_UNIMPLEMENTED_EXCEPTION())
; | 639 #define DART_UNIMPLEMENTED() Dart_ThrowException(DART_UNIMPLEMENTED_EXCEPTION())
; |
| 640 | 640 |
| 641 } // namespace WebCore | 641 } // namespace WebCore |
| 642 | 642 |
| 643 #endif // DartUtilities_h | 643 #endif // DartUtilities_h |
| OLD | NEW |