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 char message[256]; |
78 return Dart_Null(); | 78 strcpy(message, "Unsupported native browser type: "); |
79 strncat(message, DartWebkitClassInfo[cid].jsName, 255 - strlen(message)) ; | |
siva
2014/08/26 19:31:14
Why not use
snprint(message, 256, "Unsupported nat
vsm
2014/08/27 07:50:29
Done.
| |
80 Dart_Handle error = Dart_NewApiError(message); | |
81 DartUtilities::reportProblem(domData->scriptExecutionContext(), error); | |
82 type = Dart_GetType(htmlLibrary, Dart_NewStringFromCString("_Unsupported BrowserObject"), 0, 0); | |
siva
2014/08/26 19:31:14
I hope this is just a temporary solution, when we
vsm
2014/08/27 08:05:10
As long as we continue to push the types to user c
| |
79 } | 83 } |
80 | 84 |
81 persistentType = Dart_NewPersistentHandle(type); | 85 persistentType = Dart_NewPersistentHandle(type); |
82 (*table)[cid] = persistentType; | 86 (*table)[cid] = persistentType; |
83 | 87 |
84 return persistentType; | 88 return persistentType; |
85 } | 89 } |
86 | 90 |
87 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(ExceptionCode exception Code, const String& message, DartDOMData* domData) | 91 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(ExceptionCode exception Code, const String& message, DartDOMData* domData) |
88 { | 92 { |
(...skipping 17 matching lines...) Expand all Loading... | |
106 | 110 |
107 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(DartExceptionState& exc eptionState) | 111 Dart_Handle DartDOMWrapper::exceptionCodeToDartException(DartExceptionState& exc eptionState) |
108 { | 112 { |
109 DartDOMData* domData = DartDOMData::current(); | 113 DartDOMData* domData = DartDOMData::current(); |
110 DartApiScope dartApiScope; | 114 DartApiScope dartApiScope; |
111 | 115 |
112 return exceptionCodeToDartException(exceptionState.code(), exceptionState.pr ocessedMessage(), domData); | 116 return exceptionCodeToDartException(exceptionState.code(), exceptionState.pr ocessedMessage(), domData); |
113 } | 117 } |
114 | 118 |
115 } | 119 } |
OLD | NEW |