OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 var = (value); \ | 86 var = (value); \ |
87 if (UNLIKELY(block.HasCaught())) \ | 87 if (UNLIKELY(block.HasCaught())) \ |
88 exceptionState.rethrowV8Exception(block.Exception()); \ | 88 exceptionState.rethrowV8Exception(block.Exception()); \ |
89 if (UNLIKELY(exceptionState.throwIfNeeded())) \ | 89 if (UNLIKELY(exceptionState.throwIfNeeded())) \ |
90 return retVal; \ | 90 return retVal; \ |
91 } | 91 } |
92 | 92 |
93 // type is an instance of class template V8StringResource<>, | 93 // type is an instance of class template V8StringResource<>, |
94 // but Mode argument varies; using type (not Mode) for consistency | 94 // but Mode argument varies; using type (not Mode) for consistency |
95 // with other macros and ease of code generation | 95 // with other macros and ease of code generation |
96 #define TOSTRING_VOID(type, var, value) \ | 96 // Because V8StringResourceToString<Rethrow>::call does not use the instance |
97 type var(value); \ | 97 // object, we can pass null pointer to |var.init|. |
98 if (UNLIKELY(!var.prepare())) \ | 98 #define TOSTRING_VOID(type, var, value) \ |
| 99 type var(value); \ |
| 100 if (UNLIKELY(!var.init<V8StringResourceRethrowException>(0))) \ |
99 return; | 101 return; |
100 | 102 |
101 #define TOSTRING_DEFAULT(type, var, value, retVal) \ | 103 #define TOSTRING_DEFAULT(type, var, value, retVal) \ |
102 type var(value); \ | 104 type var(value); \ |
103 if (UNLIKELY(!var.prepare())) \ | 105 if (UNLIKELY(!var.init<V8StringResourceRethrowException>(0))) \ |
104 return retVal; | 106 return retVal; |
105 | 107 |
106 } // namespace WebCore | 108 } // namespace WebCore |
107 | 109 |
108 #endif // V8BindingMacros_h | 110 #endif // V8BindingMacros_h |
OLD | NEW |