OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
6 | 6 |
7 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
{ | 7 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
{ |
8 | 8 |
9 static const String INDEX_SIZE = 'IndexSizeError'; | 9 static const String INDEX_SIZE = 'IndexSizeError'; |
10 static const String HIERARCHY_REQUEST = 'HierarchyRequestError'; | 10 static const String HIERARCHY_REQUEST = 'HierarchyRequestError'; |
11 static const String WRONG_DOCUMENT = 'WrongDocumentError'; | 11 static const String WRONG_DOCUMENT = 'WrongDocumentError'; |
12 static const String INVALID_CHARACTER = 'InvalidCharacterError'; | 12 static const String INVALID_CHARACTER = 'InvalidCharacterError'; |
13 static const String NO_MODIFICATION_ALLOWED = 'NoModificationAllowedError'; | 13 static const String NO_MODIFICATION_ALLOWED = 'NoModificationAllowedError'; |
14 static const String NOT_FOUND = 'NotFoundError'; | 14 static const String NOT_FOUND = 'NotFoundError'; |
15 static const String NOT_SUPPORTED = 'NotSupportedError'; | 15 static const String NOT_SUPPORTED = 'NotSupportedError'; |
16 static const String INVALID_STATE = 'InvalidStateError'; | 16 static const String INVALID_STATE = 'InvalidStateError'; |
17 static const String SYNTAX = 'SyntaxError'; | 17 static const String SYNTAX = 'SyntaxError'; |
18 static const String INVALID_MODIFICATION = 'InvalidModificationError'; | 18 static const String INVALID_MODIFICATION = 'InvalidModificationError'; |
19 static const String NAMESPACE = 'NamespaceError'; | 19 static const String NAMESPACE = 'NamespaceError'; |
20 static const String INVALID_ACCESS = 'InvalidAccessError'; | 20 static const String INVALID_ACCESS = 'InvalidAccessError'; |
21 static const String TYPE_MISMATCH = 'TypeMismatchError'; | 21 static const String TYPE_MISMATCH = 'TypeMismatchError'; |
22 static const String SECURITY = 'SecurityError'; | 22 static const String SECURITY = 'SecurityError'; |
23 static const String NETWORK = 'NetworkError'; | 23 static const String NETWORK = 'NetworkError'; |
24 static const String ABORT = 'AbortError'; | 24 static const String ABORT = 'AbortError'; |
25 static const String URL_MISMATCH = 'URLMismatchError'; | 25 static const String URL_MISMATCH = 'URLMismatchError'; |
26 static const String QUOTA_EXCEEDED = 'QuotaExceededError'; | 26 static const String QUOTA_EXCEEDED = 'QuotaExceededError'; |
27 static const String TIMEOUT = 'TimeoutError'; | 27 static const String TIMEOUT = 'TimeoutError'; |
28 static const String INVALID_NODE_TYPE = 'InvalidNodeTypeError'; | 28 static const String INVALID_NODE_TYPE = 'InvalidNodeTypeError'; |
29 static const String DATA_CLONE = 'DataCloneError'; | 29 static const String DATA_CLONE = 'DataCloneError'; |
| 30 // Is TypeError class derived from DomException but name is 'TypeError' |
| 31 static const String TYPE_ERROR = 'TypeError'; |
30 | 32 |
31 $if DART2JS | 33 $if DART2JS |
32 String get name { | 34 String get name { |
33 var errorName = JS('String', '#.name', this); | 35 var errorName = JS('String', '#.name', this); |
34 // Although Safari nightly has updated the name to SecurityError, Safari 5 | 36 // Although Safari nightly has updated the name to SecurityError, Safari 5 |
35 // and 6 still return SECURITY_ERR. | 37 // and 6 still return SECURITY_ERR. |
36 if (Device.isWebKit && errorName == 'SECURITY_ERR') return 'SecurityError'; | 38 if (Device.isWebKit && errorName == 'SECURITY_ERR') return 'SecurityError'; |
37 // Chrome release still uses old string, remove this line when Chrome stable | 39 // Chrome release still uses old string, remove this line when Chrome stable |
38 // also prints out SyntaxError. | 40 // also prints out SyntaxError. |
39 if (Device.isWebKit && errorName == 'SYNTAX_ERR') return 'SyntaxError'; | 41 if (Device.isWebKit && errorName == 'SYNTAX_ERR') return 'SyntaxError'; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 85 |
84 $else | 86 $else |
85 $!MEMBERS | 87 $!MEMBERS |
86 $endif | 88 $endif |
87 $if DART2JS | 89 $if DART2JS |
88 @DomName('DOMException.toString') | 90 @DomName('DOMException.toString') |
89 @DocsEditable() | 91 @DocsEditable() |
90 String toString() => JS('String', 'String(#)', this); | 92 String toString() => JS('String', 'String(#)', this); |
91 $endif | 93 $endif |
92 } | 94 } |
OLD | NEW |