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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 block.ReThrow(); \ | 78 block.ReThrow(); \ |
79 return; \ | 79 return; \ |
80 } \ | 80 } \ |
81 } \ | 81 } \ |
82 if (UNLIKELY(!ok)) { \ | 82 if (UNLIKELY(!ok)) { \ |
83 throwTypeError(isolate); \ | 83 throwTypeError(isolate); \ |
84 return; \ | 84 return; \ |
85 } \ | 85 } \ |
86 } | 86 } |
87 | 87 |
| 88 #define V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(type, var, value, retVal) \ |
| 89 type var(value); \ |
| 90 if (!var.prepare()) \ |
| 91 return retVal; |
| 92 |
88 #define V8TRYCATCH_FOR_V8STRINGRESOURCE(type, var, value) \ | 93 #define V8TRYCATCH_FOR_V8STRINGRESOURCE(type, var, value) \ |
89 type var(value); \ | 94 V8TRYCATCH_FOR_V8STRINGRESOURCE_RETURN(type, var, value, v8::Undefined()); |
90 if (!var.prepare()) \ | |
91 return v8::Undefined(); | |
92 | 95 |
93 #define V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(type, var, value) \ | 96 #define V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(type, var, value) \ |
94 type var(value); \ | 97 type var(value); \ |
95 if (!var.prepare()) \ | 98 if (!var.prepare()) \ |
96 return; | 99 return; |
97 | 100 |
98 } // namespace WebCore | 101 } // namespace WebCore |
99 | 102 |
100 #endif // V8BindingMacros_h | 103 #endif // V8BindingMacros_h |
OLD | NEW |