Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: Source/bindings/v8/ExceptionState.cpp

Issue 121113004: Improve handling of failed integer type conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/bindings/v8/ExceptionState.h ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(addExceptionContext(message), m_isolate)); 83 setException(V8ThrowException::createTypeError(addExceptionContext(message), m_isolate));
84 } 84 }
85 85
86 void NonThrowableExceptionState::throwDOMException(const ExceptionCode& ec, cons t String& message)
87 {
88 ASSERT_NOT_REACHED();
89 m_code = ec;
90 }
91
92 void NonThrowableExceptionState::throwTypeError(const String&)
93 {
94 ASSERT_NOT_REACHED();
95 m_code = TypeError;
96 }
97
98 void NonThrowableExceptionState::throwSecurityError(const String&, const String& )
99 {
100 ASSERT_NOT_REACHED();
101 m_code = SecurityError;
102 }
103
86 void TrackExceptionState::throwDOMException(const ExceptionCode& ec, const Strin g& message) 104 void TrackExceptionState::throwDOMException(const ExceptionCode& ec, const Strin g& message)
87 { 105 {
88 m_code = ec; 106 m_code = ec;
89 } 107 }
90 108
91 void TrackExceptionState::throwTypeError(const String&) 109 void TrackExceptionState::throwTypeError(const String&)
92 { 110 {
93 m_code = TypeError; 111 m_code = TypeError;
94 } 112 }
95 113
(...skipping 17 matching lines...) Expand all
113 processedMessage = ExceptionMessages::failedToGet(propertyName(), in terfaceName(), message); 131 processedMessage = ExceptionMessages::failedToGet(propertyName(), in terfaceName(), message);
114 else if (m_context == SetterContext) 132 else if (m_context == SetterContext)
115 processedMessage = ExceptionMessages::failedToSet(propertyName(), in terfaceName(), message); 133 processedMessage = ExceptionMessages::failedToSet(propertyName(), in terfaceName(), message);
116 } else if (!propertyName() && interfaceName() && m_context == ConstructionCo ntext) { 134 } else if (!propertyName() && interfaceName() && m_context == ConstructionCo ntext) {
117 processedMessage = ExceptionMessages::failedToConstruct(interfaceName(), message); 135 processedMessage = ExceptionMessages::failedToConstruct(interfaceName(), message);
118 } 136 }
119 return processedMessage; 137 return processedMessage;
120 } 138 }
121 139
122 } // namespace WebCore 140 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ExceptionState.h ('k') | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698