OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 return; | 73 return; |
74 } | 74 } |
75 | 75 |
76 m_exception.set(m_isolate, exception); | 76 m_exception.set(m_isolate, exception); |
77 } | 77 } |
78 | 78 |
79 void ExceptionState::throwTypeError(const String& message) | 79 void ExceptionState::throwTypeError(const String& message) |
80 { | 80 { |
81 ASSERT(m_isolate); | 81 ASSERT(m_isolate); |
82 m_code = TypeError; | 82 m_code = TypeError; |
83 setException(V8ThrowException::createTypeError(message, m_isolate)); | 83 String processedMessage = addExceptionContext(message); |
Mike West
2013/11/29 11:28:12
Nit: I'd drop the temporary string here. You can j
sof
2013/11/29 11:36:05
Done.
| |
84 setException(V8ThrowException::createTypeError(processedMessage, m_isolate)) ; | |
84 } | 85 } |
85 | 86 |
86 void TrackExceptionState::throwDOMException(const ExceptionCode& ec, const Strin g& message) | 87 void TrackExceptionState::throwDOMException(const ExceptionCode& ec, const Strin g& message) |
87 { | 88 { |
88 m_code = ec; | 89 m_code = ec; |
89 } | 90 } |
90 | 91 |
91 void TrackExceptionState::throwTypeError(const String&) | 92 void TrackExceptionState::throwTypeError(const String&) |
92 { | 93 { |
93 m_code = TypeError; | 94 m_code = TypeError; |
(...skipping 19 matching lines...) Expand all Loading... | |
113 processedMessage = ExceptionMessages::failedToGet(propertyName(), in terfaceName(), message); | 114 processedMessage = ExceptionMessages::failedToGet(propertyName(), in terfaceName(), message); |
114 else if (m_context == SetterContext) | 115 else if (m_context == SetterContext) |
115 processedMessage = ExceptionMessages::failedToSet(propertyName(), in terfaceName(), message); | 116 processedMessage = ExceptionMessages::failedToSet(propertyName(), in terfaceName(), message); |
116 } else if (!propertyName() && interfaceName() && m_context == ConstructionCo ntext) { | 117 } else if (!propertyName() && interfaceName() && m_context == ConstructionCo ntext) { |
117 processedMessage = ExceptionMessages::failedToConstruct(interfaceName(), message); | 118 processedMessage = ExceptionMessages::failedToConstruct(interfaceName(), message); |
118 } | 119 } |
119 return processedMessage; | 120 return processedMessage; |
120 } | 121 } |
121 | 122 |
122 } // namespace WebCore | 123 } // namespace WebCore |
OLD | NEW |