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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 332 |
333 return DartUtilities::dartToDouble(asDouble, exception); | 333 return DartUtilities::dartToDouble(asDouble, exception); |
334 } | 334 } |
335 | 335 |
336 double DartUtilities::dartToDate(Dart_NativeArguments args, int idx, Dart_Handle
& exception) | 336 double DartUtilities::dartToDate(Dart_NativeArguments args, int idx, Dart_Handle
& exception) |
337 { | 337 { |
338 Dart_Handle object = Dart_GetNativeArgument(args, idx); | 338 Dart_Handle object = Dart_GetNativeArgument(args, idx); |
339 return dartToDate(object, exception); | 339 return dartToDate(object, exception); |
340 } | 340 } |
341 | 341 |
342 bool DartUtilities::isHtmlElement(DartDOMData* domData, Dart_Handle handle) | |
343 { | |
344 ASSERT(domData); | |
345 return DartDOMWrapper::instanceOf<DartHTMLElement>(domData, handle); | |
346 } | |
347 | |
348 bool DartUtilities::isDateTime(DartDOMData* domData, Dart_Handle handle) | 342 bool DartUtilities::isDateTime(DartDOMData* domData, Dart_Handle handle) |
349 { | 343 { |
350 ASSERT(domData); | 344 ASSERT(domData); |
351 Dart_Handle type = DartDOMWrapper::dartClass( | 345 Dart_Handle type = DartDOMWrapper::dartClass( |
352 domData, "DateTime", DartCoreLibraryId, _DateTimeClassId); | 346 domData, "DateTime", DartCoreLibraryId, _DateTimeClassId); |
353 ASSERT(!Dart_IsError(type)); | 347 ASSERT(!Dart_IsError(type)); |
354 return objectIsType(handle, type); | 348 return objectIsType(handle, type); |
355 } | 349 } |
356 | 350 |
357 bool DartUtilities::isBlob(DartDOMData* domData, Dart_Handle handle) | 351 bool DartUtilities::isBlob(DartDOMData* domData, Dart_Handle handle) |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 Dart_PersistentHandle library = domData->htmlLibrary(); | 1093 Dart_PersistentHandle library = domData->htmlLibrary(); |
1100 ASSERT(!Dart_IsError(library)); | 1094 ASSERT(!Dart_IsError(library)); |
1101 | 1095 |
1102 Dart_Handle utilsClass = Dart_GetType(library, Dart_NewStringFromCString("_U
tils"), 0, 0); | 1096 Dart_Handle utilsClass = Dart_GetType(library, Dart_NewStringFromCString("_U
tils"), 0, 0); |
1103 ASSERT(!Dart_IsError(utilsClass)); | 1097 ASSERT(!Dart_IsError(utilsClass)); |
1104 | 1098 |
1105 return Dart_Invoke(utilsClass, Dart_NewStringFromCString(methodName), argCou
nt, args); | 1099 return Dart_Invoke(utilsClass, Dart_NewStringFromCString(methodName), argCou
nt, args); |
1106 } | 1100 } |
1107 | 1101 |
1108 } | 1102 } |
OLD | NEW |