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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 if (Dart_IsError(type)) { | 67 if (Dart_IsError(type)) { |
68 DartUtilities::reportProblem(domData->scriptExecutionContext(), type
); | 68 DartUtilities::reportProblem(domData->scriptExecutionContext(), type
); |
69 break; | 69 break; |
70 } | 70 } |
71 | 71 |
72 if (Dart_IsNull(type)) { | 72 if (Dart_IsNull(type)) { |
73 searchid = DartWebkitClassInfo[searchid].base_class_id; | 73 searchid = DartWebkitClassInfo[searchid].base_class_id; |
74 } | 74 } |
75 } | 75 } |
76 if ((searchid <= 0) || Dart_IsError(type) || !Dart_IsType(type) || Dart_IsNu
ll(type)) { | 76 if ((searchid <= 0) || Dart_IsError(type) || !Dart_IsType(type) || Dart_IsNu
ll(type)) { |
77 DartUtilities::reportProblem(domData->scriptExecutionContext(), type); | 77 Dart_Handle error; |
78 return Dart_Null(); | 78 if (Dart_IsError(type)) { |
| 79 error = type; |
| 80 } else { |
| 81 char message[256]; |
| 82 snprintf(message, 256, "Unsupported native browser type: %s", DartWe
bkitClassInfo[cid].jsName); |
| 83 error = Dart_NewApiError(message); |
| 84 } |
| 85 DartUtilities::reportProblem(domData->scriptExecutionContext(), error); |
| 86 type = Dart_GetType(htmlLibrary, Dart_NewStringFromCString("_Unsupported
BrowserObject"), 0, 0); |
79 } | 87 } |
80 | 88 |
81 persistentType = Dart_NewPersistentHandle(type); | 89 persistentType = Dart_NewPersistentHandle(type); |
82 (*table)[cid] = persistentType; | 90 (*table)[cid] = persistentType; |
83 | 91 |
84 return persistentType; | 92 return persistentType; |
85 } | 93 } |
86 | 94 |
87 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(ExceptionCode exception
Code, const String& message, DartDOMData* domData) | 95 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(ExceptionCode exception
Code, const String& message, DartDOMData* domData) |
88 { | 96 { |
(...skipping 17 matching lines...) Expand all Loading... |
106 | 114 |
107 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(DartExceptionState& exc
eptionState) | 115 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(DartExceptionState& exc
eptionState) |
108 { | 116 { |
109 DartDOMData* domData = DartDOMData::current(); | 117 DartDOMData* domData = DartDOMData::current(); |
110 DartApiScope dartApiScope; | 118 DartApiScope dartApiScope; |
111 | 119 |
112 return exceptionCodeToDartException(exceptionState.code(), exceptionState.pr
ocessedMessage(), domData); | 120 return exceptionCodeToDartException(exceptionState.code(), exceptionState.pr
ocessedMessage(), domData); |
113 } | 121 } |
114 | 122 |
115 } | 123 } |
OLD | NEW |